#P8608. [蓝桥杯 2013 国 B] 农场阳光
[蓝桥杯 2013 国 B] 农场阳光
Problem Description
Planet X is very special: its rotation speed is the same as its revolution speed, so sunlight always shines at a fixed angle.
Recently, to develop interstellar tourism, Planet X rents out positions in space to tourists from Country Y for sunbathing. Each rented spot is a disk-shaped colored cloud floating in the air (the disk is parallel to the ground). Of course, this will block part of the sunlight, and plants on the blocked land cannot grow.
The task of this problem is to compute how large the area of land on a certain farm is that is suitable for growing crops.
Input Format
The first line of the input contains two integers , representing the length and width of a farm as and . The farm area is the rectangular region enclosed by the coordinates .
The second line contains a real number , representing the angle of sunlight. For simplicity, we assume the sunlight rays are perpendicular to the farm’s width, and the angle between them and the farm’s length is degrees. Then, the projection of a point in space onto the ground should be , where denotes the cotangent value corresponding to degrees.
The third line contains a non-negative integer , representing the number of rented spots in the air.
The next lines describe each rented spot. The -th line contains integers , indicating that the center of the -th colored cloud is at and its radius is .
Output Format
Output a real number, rounded to two decimal places, representing the area of land on the farm where crops can grow.
10 10
90.0
1
5 5 10 5
21.46
8 8
90.0
1
4 4 10 5
1.81
20 10
45.0
2
5 0 5 5
8 6 14 6
130.15
Hint
Time limit: 1 second, 64M. The 4th Lanqiao Cup National Contest in 2013.
Translated by ChatGPT 5