A STRIP OF LAND PROBLEM The residents of Dingilville are trying to locate a region to build an airport. The map of the land is at hand. The map is a rectangular grid of unit squares, each identified by a pair of coordinates (x,y), where x is the horizontal (west-east) and y is the vertical (south-north) coordinate. The height of every square is shown on the map. Your task is to find a rectangular region of squares with the largest area (i.e. a rectangular region consisting of the largest number of squares) such that
In case there is more than one such region you are required to report only one of them.
ASSUMPTIONS
INPUT The input is a text file named land.inp.
OUTPUT The output must be a text file named land.out consisting of one line containing four integers locating the region found: Xmin, Ymin, Xmax, Ymax, where (Xmin , Ymin ) is the coordinates of the southwest corner square, and (Xmax, Ymax ) is the coordinates of the northeast corner square of the region.
EXAMPLE EVALUATION Your program will be allowed to run 130 seconds. |