#P6452. [COCI 2008/2009 #4] TREZOR
[COCI 2008/2009 #4] TREZOR
Description
In the Cartesian coordinate plane, there is a rectangle whose two opposite vertices on a diagonal are and . Inside this rectangle, there are points.
Now there are two guards at the points and . They both look toward this rectangle. If a guard’s line of sight (a ray) to a point inside the rectangle is blocked by other points, then he cannot see that point.
For each point:
- If it can be seen by both guards, then it is considered very safe.
- If it can be seen by only one guard, then it is considered safe.
- If it cannot be seen by either guard, then it is considered dangerous.
Given , , and , you need to find the numbers of very safe points, safe points, and dangerous points.
Input Format
The first line contains two integers and .
The second line contains one integer .
Output Format
Output lines. Each line contains one integer, in order: the number of dangerous points, the number of safe points, and the number of very safe points.
1 1
3
2
2
5
2 3
4
0
16
8
7 11
1000000
6723409
2301730
9974861
Hint
Constraints
- For of the testdata, .
- For another of the testdata, .
- For of the testdata, , .
Notes
This problem is translated from COCI2008-2009 CONTEST #4 T5 TREZOR.
Translated by ChatGPT 5
京公网安备 11011102002149号