logo AlgoBeat OnlineJudge
登录 注册

#216583. [ICPC 2026 LAC] Crop Circles

内存限制:1024 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

After a series of unfortunate events, dubious investments, and catastrophically failed marriages, Camila has decided to leave Earth for good. She does not have enough money to build a rocket, so her best hope is to be abducted by aliens. Camila asked an AI chatbot about it, and then she independently came to the conclusion that the best way to be abducted by aliens is by making a circle of crops.

The good news is that among Camila’s poor investments there is a very large farm, which can be represented as the 2D plane. There are sprinklers located on the farm, and each of them waters all plants within a radius that depends on its power. Camila’s plan is to plant corn seeds in a perfect circle. Since the soil of the farm is very dry, the whole perimeter of Camila’s circle must be watered by some sprinkler. Notice that Camila only needs to water the perimeter of the circle, while areas inside of it may remain dry.

To maximize her abduction chances, Camila’s circle needs to be as large as possible. Since you are one of her few remaining friends, she asks for your help to determine what is the largest circle of corn she can plant on her farm, given the position and radius of each sprinkler.

输入格式

The first line contains an integer () indicating the number of sprinklers.

Each of the next lines describes a sprinkler with three integers , and ( and ), indicating that the sprinkler has coordinates and waters all plants within a radius of , inclusive.

No two sprinklers have the same location.

输出格式

Output a single line with the maximum radius of a crop circle Camila can build. Notice that although the sprinklers have integer coordinates and radii, the coordinates and radius of the crop circle are not required to be integers. The output must have an absolute or relative error of at most .

样例

样例输入 1

4
1 1 1
-1 1 1
-1 -1 1
1 -1 1

样例输出 1

1

样例输入 2

1
3 1 415

样例输出 2

415

样例输入 3

4
1 0 2
-1 0 2
0 1 2
0 -1 2

样例输出 3

2.57793547457

数据范围与提示

Explanation of Sample 1:

Camila can choose among five crop circles of radius . Four of them are centered at the sprinklers, while the remaining one is centered at .