Radar
시간 제한2초메모리 제한256 MB
원점에서의 R개 반지름과 F개 각도(광선)로 만든 격자점 중 각 질의 점에 가장 가까운 점까지의 거리를 구한다.
문제
We are using a special radar to scan an area. The radar accepts a list of distances, e.g. , , , and a list of angles, e.g. , , , , , and scans the points across all the given distances and angles. How close to some other points of interest will we be able to scan?
입력
The first line of the input gives three space-separated integers: , , , representing the number of radii, the number of angles, and the number of points of interest, respectively. Then lines follow, -th of which contains an integer , representing the distance from the radar that will be scanned. Then, lines follow, each containing two space-separated integers , , that represent Cartesian coordinates of a point, defining the -th angle. Then, lines follow, each containing two space-separated integers , , that represent the Cartesian coordinates of the -th point.
The angle, defined by the point , is the angle from the -axis to the ray from the origin through , .
출력
Output lines, -th of which should contain the distance from the point to the closest scanned point. The result will be considered correct if it is within the of absolute or relative precision.
제한
- All are pairwise distinct.
- Rays, defined by ,, are pairwise distinct.
힌트
Illustration of sample case:
