Polygon Intersection
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Given \(n\) convex polygons.
For all \(k\) from 1 to \(n\), compute the total area covered by exactly \(k\) polygons.
Input
The first line contains an integer \(n\) — the number of polygons.
The next \(n\) blocks define \(n\) polygons.
A block starts with a line containing an integer \(m_i\) — the number of vertices of the \(i\)-th polygon.
The following lines of the block contain pairs of integers \(x_{i j}\), \(y_{i j}\) separated by a space — the coordinates of the vertices of the \(i\)-th polygon in counterclockwise order.
Output
In a single line, output \(n\) real numbers — the answer to the problem.
The answer will be considered correct if the absolute or relative error of each output number does not exceed \(10^{-7}\).
Constraints
\(1 \le n \le 50\),
\(3 \le m_i\),
\(3 \le \sum_{i=1} ^n m_i \le 10^3\),
\(|x_{i j}|, |y_{i j}| \le 10^5\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 2 4 0 0 5 0 5 1 0 1 4 2 -1 3 -1 3 3 2 3 | 7 1 |
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 |
|---|