#P9100. [PA 2020] Miny
[PA 2020] Miny
Problem Description
This problem is translated from PA 2020 Round 3 Miny.
mines were delivered to the military training ground in Bytau and buried along a straight line. Each mine is located at a different position and has its own explosion radius. When a mine is detonated, it automatically detonates all mines that have not yet exploded and are within its explosion radius. If the distance between mine and mine is not greater than mine 's explosion radius, then we say that mine is within mine 's explosion radius.
Sergeant Bytomir wants to conduct an experiment. He chooses an arbitrary subset of mines (possibly empty) and manually detonates all mines in this subset at the same time. The result of the experiment is a set of mines that have exploded—either because they were manually detonated, or because they were detonated by other exploding mines.
How many different experiment results are possible for Bytomir? Two experiment results are considered the same if the sets of exploded mines are the same. Since the answer can be large, output it modulo .
Input Format
The first line contains an integer , the number of mines.
The next lines each contain two integers , representing the position and explosion radius of a mine. You may assume that .
Output Format
Output the number of possible experiment results modulo .
4
0 2
2 0
3 2
7 4
7
Hint
Explanation of Sample 1
You can obtain different experiment results:
- (the empty set): if you do not detonate any mine;
- (mines ): if we detonate only mine ;
- : if we detonate mines and ;
- : if we detonate mines and ;
- : if we detonate only mine ;
- : if we detonate only mine ;
- : if we detonate only mine .
Note that the same experiment result can be obtained in different ways—for example, if we detonate mines and , we also get the result .
Constraints
This problem uses bundled testdata.
For of the testdata, it is guaranteed that , .
Translated by ChatGPT 5