#P10718. 【MX-X1-T6】「KDOI-05」简单的图上问题
【MX-X1-T6】「KDOI-05」简单的图上问题
Background
Original link: https://oier.team/problems/X1F。
Problem Description
You are given an edge-biconnected graph with vertices and edges, and the coordinates of each vertex are given. It is guaranteed that any two edges do not intersect, or only overlap at their endpoints.
You are given simple cycles on the graph . Define as the graph consisting of only the vertices and edges inside .
For , define as the number of connected components in the intersection of all .
There are queries. Each time you are given a , output . Take the result modulo .
Input Format
The first line contains three positive integers .
The next lines each contain two integers , representing the coordinates of the -th vertex. It is guaranteed that for all , both and hold.
The next lines each contain two positive integers , representing an undirected edge connecting .
The next lines: the first positive integer on each line is , the size of the cycle, followed by positive integers describing a simple cycle in the original graph. It is guaranteed that connecting in order forms a cycle in the original graph.
Then one line contains one positive integer .
The last lines each contain one positive integer, the query value .
Output Format
Output lines. Each line contains one integer, the value of modulo .
4 5 3
1 1
3 2
2 3
4 4
1 2
1 3
1 4
2 4
3 4
3 1 2 4
3 1 3 4
4 1 2 4 3
3
1
2
3
3
3
1
8 15 5
4 4
5 8
2 7
10 9
1 10
3 5
8 2
7 6
2 1
3 1
3 2
4 1
4 2
5 2
5 3
5 4
6 1
6 3
7 1
7 4
8 1
8 4
8 7
3 1 8 4
3 1 6 3
3 7 8 4
4 8 1 7 4
3 1 2 3
5
1
2
3
4
5
5
8
5
1
0
Hint
Sample Explanation #1
The data of sample is shown in the figure:

Constraints
This problem uses bundled testdata.
| Subtask ID | Score | Special Property | |
|---|---|---|---|
| None | |||
| It is guaranteed that the planar graph is a triangulation of a convex hull | |||
| None | |||
For of the data: , , , , , , , . It is guaranteed that for all , both and hold. It is guaranteed that any two edges do not intersect, or only overlap at their endpoints, and the graph is an edge-biconnected component.
Translated by ChatGPT 5