King of the Hill
문제
The king of Belle Aire People's Country has come up with a new plan: he has heard about the popular phenomenon called "King of the Hill", and he would like to become one as well. To do so, he has ordered you to raise a flag on the highest hill in his square kingdom, which has dimensions . You are given a very expensive (it is gold- and jewel-embedded) satellite-based height-measuring system. This equipment is highly accurate: the heights on every location in the kingdom are represented with distinct integers. However, to cut costs, you are only allowed to take measurements before reporting back to the king.
Furthermore, you know for certain that there is only a single point that is the absolute highest: this is the only point for which its height is larger than the (up to) four orthogonally adjacent points that lie inside the kingdom. In other words, there are no local maxima besides the global maximum.
예제
예제 1
3 3 9 4 8 7
? 2 1 ? 2 2 ? 2 3 ? 3 2 ? 1 2 ! 9
예제 2
4 600000000 864213579 864297531 987654321 123456789 975318642
? 3 3 ? 2 3 ? 2 2 ? 1 2 ? 1 1 ? 1 3 ! 987654321