Soccer Skills
Time limit2sMemory limit512 MB
Among all teammates whose distance from you is between a and b, print the position, distance, and angle of the one with smallest x then smallest y.
- Level
Easy2 of 10
- Topics
- Implementation, Geometry, Brute force
- Solved
- No attempts yet
Problem
At the company soccer tournament your boss is watching the game you are playing in. You are a good soccer player and you can make sharp passes. You look around at your team mates to see whether any of them is close enough for a reliable pass and far enough away to impress your boss.
You can reliably pass to a team mate whose distance from you is at most , and your boss is impressed only when that distance is at least .
Input
The first line has an integer (), the number of team mates on the field.
The second line has two floating point numbers and (). is the least distance at which your boss is impressed, and is the largest distance at which you can reliably pass.
The third line has two integers and (), your position on the playing field.
Each of the next lines has two integers and (), the position of one team mate.
Output
If no team mate is at a distance of at least and at most from you, print one line with the word impossible.
Otherwise several team mates may qualify. Take the one with the smallest , and if several of them remain, take the one with the smallest . Print one line with four values separated by single spaces: the integers and , the distance from you to that team mate, and the angle at which you have to shoot. The angle lies in and is measured counter-clockwise from the positive axis. Print the distance and the angle rounded to 8 digits after the decimal point.