Cloyster
시간 제한2초메모리 제한512 MB
모든 칸이 인접한 칸 중 더 큰 값을 가진 칸을 하나 이상 가지는 n x n 격자에서 3n + 210번 이하의 질의로 최댓값을 가진 칸을 찾는다.
문제
You just found yourself in a huge field of Cloyster specimens somewhere on the seabed off the coast of Japan. They're quite mad at you as you tried to catch one of them a moment ago. You must immediately find the leader of the pack and beg him for forgiveness. Where is he, though?
The field contains square cells grouped into rows and columns. Each cell contains a single Cloyster hidden in its own shell. Now, I can reveal to you a couple of little-known facts about Cloyster:
- The leader has the largest shell. Obviously.
- All Cloyster in the pack have shells of different sizes.
- Each Cloyster other than the leader has a neighbor with a larger shell in some cell adjacent to its own cell by an edge or by a corner.
You can query individual specimens for the sizes of their shells. Use this information to locate the leader of the pack. Be quick, though --- if you don't find him in queries, Cloyster will run out of patience and they'll attack you!
힌트
Here are the sizes of each Cloyster in both sample tests:


Note, that the communication in the second sample test is correct --- your program is allowed to make a guess even if it isn't certain about the correctness of the answer.