#P5976. [CEOI 2008] Dominance
[CEOI 2008] Dominance
Description
A rectangle with width and height is given.
There are two types of points on it: and . Each point has its own radiation range. For any other point, if it receives more radiation from white points than from black points, it becomes a white point; otherwise, it becomes a black point. If the amounts are equal, it is neutral.
Given the coordinates and radiation ranges of all white and black points, find how many white points and how many black points there will be in the end.
Input Format
The first line contains and . The bottom-left corner is , and the top-right corner is .
The second line contains an integer , the number of points.
The next lines each contain, in order: the point’s type, its coordinates, and its radiation range (in ).
Output Format
Output two numbers: the number of white points and the number of black points, respectively.
10 10
3
W 3 6 3
B 6 4 2
W 3 3 2
30 9
Hint
For of the testdata, , .
Sample Explanation:

Translated by ChatGPT 5
京公网安备 11011102002149号