Radar

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

We are using a special radar to scan an area. The radar accepts a list of distances, e.g. 22, 44, 11, and a list of angles, e.g. 100100^◦, 270270^◦, 180180^◦, 1010^◦, 300300^◦, 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: RR, FF, NN, representing the number of radii, the number of angles, and the number of points of interest, respectively. Then RR lines follow, ii-th of which contains an integer r_ir\_i, representing the distance from the radar that will be scanned. Then, FF lines follow, each containing two space-separated integers (f_x)_i(f\_x)\_i, (f_y)_i(f\_y)\_i, that represent Cartesian coordinates of a point, defining the ii-th angle. Then, NN lines follow, each containing two space-separated integers x_ix\_i, y_iy\_i, that represent the Cartesian coordinates of the ii-th point.

The angle, defined by the point (f_x)_i(f\_x)\_i, (f_y)_i(f\_y)\_i is the angle from the xx-axis to the ray from the origin through (f_x)_i(f\_x)\_i, (f_y)_i(f\_y)\_i.

출력

Output NN lines, ii-th of which should contain the distance from the point (x_i,y_i)(x\_i , y\_i) to the closest scanned point. The result will be considered correct if it is within the 10610^{-6} of absolute or relative precision.

제한

  • 1R,F,N1051 ≤ R, F, N ≤ 10^5
  • x_i,y_i,(f_x)_i,(f_y)_i,r_i<106|x\_i|, |y\_i|, |(f\_x)\_i|, |(f\_y)\_i|, r\_i < 10^6
  • (f_x)2_i+(f_y)2_i,r_i>0(f\_x)^2\_i + (f\_y)^2\_i , r\_i > 0
  • All r_ir\_i are pairwise distinct.
  • Rays, defined by (f_x)_i(f\_x)\_i,(f_y)_i(f\_y)\_i, are pairwise distinct.

힌트

Illustration of sample case: