問題一覧 > 通常問題

No.764 Floating Points

レベル : / AI推定難易度 : 1800 / 実行時間制限 : 1ケース 1.500秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 27
作問者 : りあん / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 1593 / 自分の提出
問題文最終更新日: 2018-12-11 23:26:02
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2018 (順位表) の他の問題:

Problem Statement

There are 2 fixed points $P_0, \ P_{N+1}$ on a plane, and the distance (Euclidean distance) between $P_0$ and $P_{N+1}$ is $L_0$.

In addition to the 2 fixed points above, there are $N$ moving points $P_1, \ P_2, \ \ldots , \ P_N$ on this plane, which move while satisfying the following.

  • The distance between $P_{i-1}$ and $P_i$ is $L_i \ (1 \le i \le N+1)$.

For each of the $N$ moving points $P_1, \ P_2, \ \ldots , \ P_N$, find the area of the region in which it can move.

If the region in which a point can move consists only of points or lines, or if no region satisfying the above condition exists, the area is considered to be $0$.

Also, if the region in which a point can move is divided into 2 or more parts, output the sum of their areas.

Input

$N$
$L_0$
$L_1$
$\ldots$
$L_{N+1}$

The first line contains an integer $N$, the number of moving points.

The i-th $(1 \le i \le N+2)$ of the following $N + 2$ lines contains an integer $L_{i-1}$.

$L_i$ represents

  • the distance between $P_0$ and $P_{N+1}$ when $i = 0$;
  • the distance between $P_{i-1}$ and $P_i$ when $1 \le i \le N+1$.


The input consists of $N + 3$ lines in total and satisfies the following constraints.

  • All input values are integers.
  • $3 \le N \le 1000$
  • $1 \le L_i \le 1000 \ (0 \le i \le N+1)$

Output

$S_1$
$S_2$
$\ldots$
$S_N$

The expected output consists of $N$ lines.

On the i-th line $(1 \le i \le N)$, output the area of the region in which the moving point $P_i$ can move.

Your answer is considered correct if the absolute or relative error is at most $10^{-6}$.

Print a newline at the end.

Sample

Sample 1
Input
3
8
3
5
3
4
Output
0
58.62347424991461
0

Sample 2
Input
4
16
1
2
3
4
5
Output
0
0
0
0

No points satisfying the conditions exist.

Sample 3
Input
12
10
900
800
700
600
500
400
300
200
100
200
300
400
500
Output
0
9047786.842338604
18095573.68467721
26420794.21669016
18095573.68467721
12566370.61435917
9079202.768874502
7068583.470577035
6157521.601035995
4523893.421169302
2513274.122871834
0

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。