Gollum and pizza
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Gollum loves round objects. He also loves to eat. And especially he loves to eat pizza, while wearing the Ring on his finger.
Once he baked a huge-huge pizza and, in a hurry, made \(n\) cuts in it. Each cut was straight, started at the center of the pizza and ended at its edge. As it happened, the resulting pieces turned out to be completely different.
Gollum wants to make only one additional cut from the center of the pizza to the edge so that the size of the maximum pizza piece is as small as possible.
It is known that Gollum made the \(i\)-th cut at an angle of \(a_i\) degrees.
Determine the minimum possible size of the maximum pizza piece.
Input
The first line contains a single integer \(n\) — the number of cuts Gollum has already made.
The second line contains \(n\) integers \(a_i\) — the angles in degrees at which Gollum cut the pizza (from the center to the edge).
Output
In a single line, output a single number with exactly one decimal place — the minimum possible size of the maximum pizza piece.
The size of a piece is understood as the measure of the central angle of the circular sector corresponding to this piece.
Constraints
\(2 \le n \le 360\),
\(0 \le a_i \le 359\),
all \(a_i\) are distinct.
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 3 45 180 90 | 112.5 |
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|