Solved

# Programming Problem

Posted on 2006-05-22

I am trying to solve this problem. I cannot seem to figure it out. I need to find the regional highest height from a subsection of a map. The regional highest height can be a point whose height is higher than all of its neighbors. The interior points have 8 neighbors, edge has 5 and corner has 3.

The input file is given below:

3 3

90 35°43'9" 45°45'19" 8 36°46'19" 51°25'19" 45 36°46'19" 11°25'39"

7 35°23'9" 25°43'9" 25 25°43'9" 35°33'39" 30 32°33'9" 17°33'22"

6 15°43'19" 25°43'29" 108 39°33'40" 25°23'29" 565 25°23'29" 15°41'19"

First number is the height, second is the longitude and third is the latitude. So For example, in the first record 90 is the height, 35°43'9" is the longitude and 45°45'19" is the latitude.

The answer is the maximum heights are 90, 45, 565. I am not sure how to come to this answer. I would really appreciate any help. Thanks.