svemir

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Space shuttle has lost its black-box somewhere in the universe, and the crew is trying to find it as soon as possible.

Signal emitted from the box is not strong enough to determine the exact position of the box. However, when the spaceship moves, the instruments can determine if the signal from the box is now stronger or weaker than before, and hence the crew knows if the spaceship is now closer or further from the box.

The universe is a three-dimensional space consisted of NxNxN small squares. Each square is represented by three coordinates, all of them are positive integers less than or equal to N.

At the beginning, spaceship is located in the square (1,1,1), and the black-box is at an different unknown location.

Write a program that will find the black-box (i.e. by moving the spaceship to the exact position of the black-box) with at most 200 calls to function Pomak.

제한

  • 2 ≤ N ≤ 1,000,000,000