Submit | All submissions | Best solutions | Back to list |
C24E08AT - EC08A The Sheep of the Wizard (T) |
XY, the great wizard has a flock of sheep. These sheep are of a quite calm type, they do not wander all about the place like normal sheep do, they just stay where they are, each at a given point on the plane. Nevertheless the sheep have to be watched. Until now, the wizard looked after them himself, as he was pleased to count them again and again and enjoyed seeing how rich he was.
But now, he kind of got bored of counting sheep. He decided to use his magic powers to turn one of his sheep into a shepherd. Your task is to choose the right sheep for him, unless you want to make him mad, and be turned into a sheep – or something much worse – yourself. Given the coordinates of the sheep, you have to find one that if turned into shepherd can watch all the others with the least eye movement. That is, find the one sheep from which the rest of the flock is seen in the smallest angle.
Input:
The first line contains a single integer, N the number of sheep specification lines. The following N lines contain the X and Y coordinates of the sheep separated by spaces.
Output:
Two integers, X and Y , separated by a space, that are the coordinates of the best sheep.
This is the text variant of the problem. Read more here about submitting solutions!
Example
Input: 3 0 0 1 1 10 0 Output: 10 0
Added by: | Jacek DÄ…browski |
Date: | 2009-02-04 |
Time limit: | 0.200s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C++ 4.3.2 TEXT |
Resource: | Challenge 24 2008 Electronic Contest |