#P5617. [MtOI2019] 不可视境界线
[MtOI2019] 不可视境界线
Background
「爆ぜろリアル!弾けろシナプス!パニッシュメント......ディス、ワールド!」
「Explode, reality! Shatter, mind! Banish this world!」
Problem Description
Rikka firmly believes that her father is waiting for her inside the “Invisible Boundary Line”. In Rikka’s dream, the “Invisible Boundary Line” appeared as a figure made up of circles.
Specifically, there is a Cartesian coordinate system. On the -axis, there are points, and the -th point is .
Using each point as a center, Rikka drew circles with radius . She originally wanted you to help her compute the union area of these circles, but that problem is too easy.
After some thought, Rikka wants you to compute the maximum possible union area of the circles after selecting circles (i.e., deleting circles).
For all testdata, , , , are integers and pairwise distinct. It is guaranteed that the input are strictly increasing.
Because the answer is very large, and Rikka thinks your computer cannot maintain high precision, your answer will be considered correct as long as its relative error is less than compared to the standard answer.
After error analysis, this problem guarantees that using the native cmath functions will not cause issues. Please pay attention to controlling precision errors in your program.
Input Format
There are lines in total.
Line contains integers , , and .
Line contains integers .
Output Format
Output one real number in one line, representing the required answer. It is guaranteed that the answer is less than .
8 5 2
1 3 7 11 15 21 27 33
62.83185307
8 5 8
1 3 7 11 15 21 27 33
686.19551835
Hint
Sample Explanation 1
Obviously, you can choose non-overlapping circles with radius .
Subtasks
For of the testdata, , , .
This problem uses bundled tests. There are subtasks, and the score and constraints of each subtask are as follows:
Subtask ( points): .
Subtask ( points): .
Subtask ( points): , .
Subtask ( points): , and the testdata are guaranteed to be randomly generated.
Subtask ( points): .
Subtask ( points): , .
Subtask ( points): no special constraints.
Source
Problem setter: disangan233
Problem reviewer: suwAKow, _sys
Translated by ChatGPT 5