102551: [AtCoder]ABC255 B - Light It Up

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

Problem Statement

There are $N$ people numbered $1, 2, \dots, N$ in the $xy$-plane. Person $i$ is at the coordinates $(X_i, Y_i)$.
$K$ of these people, Persons $A_1, A_2, \dots, A_K$, will receive lights of the same strength.
When a person at coordinates $(x, y)$ has a light of strength $R$, it lights up the interior of a circle of radius $R$ centered at $(x, y)$ (including the boundary).
Find the minimum strength of the lights needed for every person to be lit by at least one light.

Constraints

  • All values in input are integers.
  • $1 \le K < N \le 1000$
  • $1 \le A_1 < A_2 < \dots < A_K \le N$
  • $|X_i|,|Y_i| \le 10^5$
  • $(X_i,Y_i) \neq (X_j,Y_j)$, if $i \neq j$.

Input

Input is given from Standard Input in the following format:

$N$ $K$
$A_1$ $A_2$ $\dots$ $A_K$
$X_1$ $Y_1$
$X_2$ $Y_2$
$\vdots$
$X_N$ $Y_N$

Output

Print the answer as a real number.
Your output will be considered correct if its absolute or relative error from the judge's output is at most $10^{-5}$.


Sample Input 1

4 2
2 3
0 0
0 1
1 2
2 0

Sample Output 1

2.23606797749978969

This input contains four people. Among them, Persons $2$ and $3$ will have lights.
Every person will be lit by at least one light if $R \ge \sqrt{5} \approx 2.236068$.


Sample Input 2

2 1
2
-100000 -100000
100000 100000

Sample Output 2

282842.712474619009

Sample Input 3

8 3
2 6 8
-17683 17993
93038 47074
58079 -57520
-41515 -89802
-72739 68805
24324 -73073
71049 72103
47863 19268

Sample Output 3

130379.280458974768

Input

题意翻译

有 $n$ 盏灯,有 $m$ 盏灯是亮的,这 $m$ 盏灯分别为 $A_1$ 到 $A_m$,每盏灯有个坐标,问,当 $m$ 盏灯所能照亮的半径为多少时,所有灯会被照亮

Output

分数:$200$分

问题描述

在$xy$平面上有$N$个人,编号为$1, 2, \dots, N$。第$i$个人在坐标$(X_i, Y_i)$处。
其中的$K$个人,编号为$A_1, A_2, \dots, A_K$,将收到相同强度的灯光。
当一个人在坐标$(x, y)$处有一盏强度为$R$的灯时,它会照亮以$(x, y)$为中心,半径为$R$的圆的内部(包括边界)。
找出使每个人都能被至少一盏灯照亮所需的灯光的最小强度。

约束条件

  • 输入中的所有值都是整数。
  • $1 \le K < N \le 1000$
  • $1 \le A_1 < A_2 < \dots < A_K \le N$
  • $|X_i|,|Y_i| \le 10^5$
  • 如果$i \neq j$,则$(X_i,Y_i) \neq (X_j,Y_j)$。

输入

输入从标准输入中给出,格式如下:

$N$ $K$
$A_1$ $A_2$ $\dots$ $A_K$
$X_1$ $Y_1$
$X_2$ $Y_2$
$\vdots$
$X_N$ $Y_N$

输出

以实数形式打印答案。
如果您的输出与法官的输出绝对或相对误差不超过$10^{-5}$,则将被认为是正确的。


样例输入1

4 2
2 3
0 0
0 1
1 2
2 0

样例输出1

2.23606797749978969

此输入包含四个人。其中,第$2$和$3$个人将有灯光。
如果$R \ge \sqrt{5} \approx 2.236068$,那么每个人将至少被一盏灯照亮。


样例输入2

2 1
2
-100000 -100000
100000 100000

样例输出2

282842.712474619009

样例输入3

8 3
2 6 8
-17683 17993
93038 47074
58079 -57520
-41515 -89802
-72739 68805
24324 -73073
71049 72103
47863 19268

样例输出3

130379.280458974768

加入题单

算法标签: