実行時間制限: 2 sec / メモリ制限: 1024 MB
配点 : 600 点
問題文
平面上の N 個の点 (x_i, y_i) が与えられます。
これら全てを内部または周上に含む円の半径の最小値を求めてください。
制約
- 2 ≤ N ≤ 50
- 0 ≤ x_i ≤ 1000
- 0 ≤ y_i ≤ 1000
- 与えられる N 点は全て異なる
- 入力で与えられる値は全て整数
入力
入力は以下の形式で標準入力から与えられる。
N x_1 y_1 : x_N y_N
出力
N 個全ての点を内部または周上に含む円の半径の最小値を出力せよ。
なお、想定解答との絶対誤差または相対誤差が 10^{-6} 以下であれば正解として扱われる。
入力例 1
2 0 0 1 0
出力例 1
0.500000000000000000
2 つの点は中心 (0.5,0) 、半径 0.5 の円に含まれます。
入力例 2
3 0 0 0 1 1 0
出力例 2
0.707106781186497524
入力例 3
10 10 9 5 9 2 0 0 0 2 7 3 3 2 5 10 0 3 7 1 9
出力例 3
6.726812023536805158
想定解答との絶対誤差または相対誤差が 10^{−6} 以下であれば正解として扱われます。
Score : 600 points
Problem Statement
Given are N points (x_i, y_i) in a two-dimensional plane.
Find the minimum radius of a circle such that all the points are inside or on it.
Constraints
- 2 \leq N \leq 50
- 0 \leq x_i \leq 1000
- 0 \leq y_i \leq 1000
- The given N points are all different.
- The values in input are all integers.
Input
Input is given from Standard Input in the following format:
N x_1 y_1 : x_N y_N
Output
Print the minimum radius of a circle such that all the N points are inside or on it.
Your output will be considered correct if the absolute or relative error from our answer is at most 10^{-6}.
Sample Input 1
2 0 0 1 0
Sample Output 1
0.500000000000000000
Both points are contained in the circle centered at (0.5,0) with a radius of 0.5.
Sample Input 2
3 0 0 0 1 1 0
Sample Output 2
0.707106781186497524
Sample Input 3
10 10 9 5 9 2 0 0 0 2 7 3 3 2 5 10 0 3 7 1 9
Sample Output 3
6.726812023536805158
If the absolute or relative error from our answer is at most 10^{-6}, the output will be considered correct.