Article directory
Question description
Once upon a time there was a village, and the villagers liked to put small flags on various fields, with various numbers marked on the flags.
One day, the collective villagers decided to allocate the minimum matrix-shaped land covering the same number to the villagers who made great contributions to the village. In this allocation of land, what is the maximum area that the contributing villagers will be allocated?
Enter description
Enter m and n in the first line,
- m represents the length of the village’s land
- n represents the width of the land
The second line begins to enter the specific identification on the map.
Output description
When allocating land this time, what is the maximum area that will be allocated to the villagers who contributed?
Remark
The numbers on the flag range from 1 to 500, and the side length of the land does not exceed 500
Land without a flag is marked with 0