Problem D
Dragon Balls

The balls are hidden at unknown locations in a 2D plane and
you have been handed a Dragon Radar, designed by Bulma, that
you must use to locate them. You can repeatedly fly to
arbitrary locations, and the radar will then inform you about
the distance to the closest Dragon Ball. If this distance is
With the battle still going on, and the radar having limited
energy, you are obviously in a great hurry. You need to make
sure to collect all the balls by using the radar no more than
Interaction
This is an interactive problem. Your submission will be run against an interactor, which reads the standard output of your submission and writes to the standard input of your submission. This interaction needs to follow a specific protocol:
The interactor first sends an integer
Your submission then repeatedly sends such an integer
location
If
Make sure you flush the buffer after each write.
A testing tool is provided to help you develop your solution.
Read | Sample Interaction 1 | Write |
---|
1
0 0
25
3 4
2
4 3
0
Read | Sample Interaction 2 | Write |
---|
2
2 1
8
5 5
0
4 2
1
4 3
0