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.
Easy2ImplementationGeometryBrute forceNo attempts yetTime limit2sMemory limit512 MBAt 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 b, and your boss is impressed only when that distance is at least a.
The first line has an integer N (1≤N≤106), the number of team mates on the field.
The second line has two floating point numbers a and b (0≤a,b≤1000). a is the least distance at which your boss is impressed, and b is the largest distance at which you can reliably pass.
The third line has two integers px and py (−1000≤px,py≤1000), your position on the playing field.
Each of the next N lines has two integers qx and qy (−1000≤qx,qy≤1000), the position of one team mate.
If no team mate is at a distance of at least a and at most b from you, print one line with the word impossible.
Otherwise several team mates may qualify. Take the one with the smallest qx, and if several of them remain, take the one with the smallest qy. Print one line with four values separated by single spaces: the integers qx and qy, 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 x axis. Print the distance and the angle rounded to 8 digits after the decimal point.