QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 1024 MB 満点: 100 ハック可能 ✓

#17893. Superb Dart

統計

The members of Superb AI have created a new game called Superb Dart to settle bets on the price of coffee. The rules of Superb Dart are as follows:

  • A dartboard is drawn on a 2D plane.

  • The dartboard is a graph formed by vertices with integer coordinates and edges connecting them.

    • No two distinct vertices have the same coordinates.
    • The resulting graph is a simple graph (no multiple edges) and a connected graph (a path always exists between any two vertices).
    • Distinct edges do not intersect, and if they touch, they can only do so at a shared vertex (this is equivalent to a planar graph).
  • When a dart is thrown at this board, the score obtained in a single attempt is inversely proportional to the area of the region containing the point where the dart lands.

    • A region containing a point on the dartboard is the set of points that can be connected to that point by a path that does not cross or touch the edges of the dartboard (here, a path refers to a path on the plane, not a path on the graph; it can be a curve).
    • Cases where the area is infinite or zero (when the dart lands outside the board, or directly on a vertex or an edge) are not considered regions and result in a score of 0.

The curious members of Superb AI are interested in the combinations of scores that can be obtained from such a dartboard. To solve this, they first want to calculate the areas of the regions on the dartboard given its configuration.

Input

The first line contains the number of vertices $N$ and the number of edges $M$ ($1 \le N, M \le 100\,000$). Each vertex is numbered from 1 to $N$, and each edge is numbered from 1 to $M$.

The next $N$ lines provide the coordinates of the vertices. The $i$-th line contains the $x$ and $y$ coordinates of vertex $i$, separated by a space. No duplicate coordinates are provided. ($-10^6 \le x, y \le 10^6$)

The next $M$ lines provide the edges of the dartboard. The $i$-th line contains the two endpoints $s$ and $e$ of edge $i$. The endpoints are distinct, no two distinct edges connect the same pair of vertices, and any two edges share at most one intersection point. If any two distinct edges share an intersection point, they must share an endpoint, and that intersection point is exactly that shared endpoint. ($1 \le s, e \le N, s \neq e$)

The given dartboard is guaranteed to be connected.

Output

The first line should output the number of valid regions $S$ on the dartboard (where the area is greater than 0 and finite).

The next $S$ lines should output the areas of these regions, rounded to the second decimal place, in ascending order.

Examples

Input 1

5 6
0 0
0 1
0 3
1 1
1 3
1 2
2 3
1 4
2 4
4 5
3 5

Output 1

2
0.5
2.0

Input 2

10 13
2 0
6 4
8 6
2 6
4 2
8 2
0 2
10 2
12 2
12 6
3 2
1 7
10 8
3 6
5 6
2 6
9 10
4 7
6 8
8 9
4 5
1 5
3 4

Output 2

4
4.0
4.0
12.0
16.0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.