#P13770. [CERC 2021] Radar

    ID: 15591 远端评测题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 4 上传者: 标签>计算几何二分2021Special JudgeICPCCERC

[CERC 2021] Radar

题目描述

We are using a special radar to scan an area. The radar accepts a list of distances, e.g. 2, 4, 1, and a list of angles, e.g. 100100^\circ, 270270^\circ, 180180^\circ, 1010^\circ, 300300^\circ, 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 rir_i, representing the distance from the radar that will be scanned. Then, FF lines follow, each containing two space-separated integers (fx)i(f_x)_i, (fy)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 xix_i, yiy_i, that represent the Cartesian coordinates of the ii-th point.

The angle, defined by the point (fx)i(f_x)_i, (fy)i(f_y)_i is the angle from the xx-axis to the ray from the origin through (fx)i(f_x)_i, (fy)i(f_y)_i.

输出格式

Output NN lines, ii-th of which should contain the distance from the point (xi,yi)(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.

3 7 5
2
4
7
8 4
2 8
-1 5
-7 2
-4 -4
1 -8
6 -3
3 -1
8 1
2 6
-5 2
-1 -1
0.977772290466
2.750120773895
0.846777708005
1.464071052924
0.585786437627

提示

Comment

Illustration of sample case:

:::align{center} :::

Input limits

  • 1R,F,N1051 \leq R, F, N \leq 10^5
  • xi,yi,(fx)i,(fy)i,ri<106|x_i|, |y_i|, |(f_x)_i|, |(f_y)_i|, r_i < 10^6
  • (fx)i2+(fy)i2,ri>0(f_x)_i^2 + (f_y)_i^2, r_i > 0
  • All rir_i are pairwise distinct.
  • Rays, defined by (fx)i,(fy)i(f_x)_i, (f_y)_i, are pairwise distinct.