#P6641. [CCO 2020] A Game with Grundy
[CCO 2020] A Game with Grundy
Description
All discussions in this problem take place on the Cartesian coordinate plane.
There are people. Each person has a field of view, and each person is located at .
A field of view can be modeled as an angle.
Note that the two rays that form the angle are not included in the field of view.
Now, you may stand at , where .
For each , find how many positions you can stand at such that you are inside the field of view of at most people.
Input Format
The first line contains an integer .
The second line contains three integers .
The next lines each contain three integers . Here, and mean that the slopes of the two rays forming the angle are and , and one endpoint is at .
Output Format
There are lines, each containing one integer. The value on line indicates the number of positions where you can stand such that you are inside the field of view of at most people.
3
-7 7 3
0 2 3
-4 2 1
3 3 1
5
12
15
15
Hint
Sample Explanation

Subtasks
This problem uses bundled testdata.
- Subtask 1 ( points): It is guaranteed that .
- Subtask 2 ( points): No additional constraints.
For of the testdata, it is guaranteed that , , , , and .
Notes
This problem is translated from Canadian Computing Olympiad 2020 Day 1 T1 A Game with Grundy.
Translated by ChatGPT 5
京公网安备 11011102002149号