| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 1024 MB | 16 | 14 | 13 | 86.667% |
The Johnson Space Center has hired you to design NASA’s new communications satellite! The satellite, consisting of a set of dish antennas held together with titanium beams, must meet NASA’s exacting specifications, but a lot of the design is up to you.
Specifically, the design can be represented by a set of circles of various radii (representing the dish antennas) and line segments (the beams) in the 2D plane. A valid satellite design must meet all of the following criteria:
Titanium isn’t cheap these days, so you want to compute the cheapest possible compliant design: the one that minimizes the sum of the beam lengths.
The first line of the input contains a single integer 1ドル \leq N \leq 2,円 000,ドル the number of dish antennas attached to the satellite.
Then follow $N$ lines, each of which contains three integers $X,ドル $Y,ドル and $R$ specifying the location and radius of one dish antenna. These integers satisfy the bounds $-1,円 000 \leq X, Y\leq 1,円 000$ and 1ドル\leq R \leq 100$.
Compute the satellite design that minimizes the sum of beam lengths, while obeying the above specifications, and print that sum. The answer is considered correct if the absolute or relative error is less than 10ドル^{-6}$.
4 3 4 3 0 0 2 4 -2 2 9 4 1
2.47213595
Illustration of the sample input solution (beams in blue).