P29886 [洛谷] [Lanqiao Cup 2013 National B] Farm Sunlight
提高
题目描述

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 has rented out its spatial positions to tourists from Country Y for sunbathing. Each rental spot is a circular cloud floating in the air (the disk is parallel to the ground). Of course, this blocks some sunlight, and the land that is blocked cannot grow plants.

The task of this problem is to calculate the area of land in a certain farm that is suitable for crop growth.

Input Format

The first line of the input data contains two integers \(a, b\), indicating that the length and width of a certain farm are \(a\) and \(b\) respectively. At this time, the range of the farm is the rectangular area enclosed by the coordinates \((0,0,0), (a,0,0), (a,b,0), (0,b,0)\).

The second line contains a real number \(g\), indicating the angle of sunlight. For simplicity, we assume that the sunlight rays are perpendicular to the width of the farm, and at this time, the angle with the length of the farm is \(g\) degrees. At this time, a point \((x,y,z)\) in space should project onto the ground as \((x + z \times \cot(g), y, 0)\), where \(\cot(g)\) represents the cotangent of \(g\) degrees.

The third line contains a non-negative integer \(n\), indicating the number of rental spots in the air.

The next \(n\) lines describe each rental spot. The \(i\)-th line contains 4 integers \(x_i, y_i, z_i, r_i\), indicating that the center of the \(i\)-th rental spot cloud is at position \((x_i, y_i, z_i)\) with a radius of \(r_i\).

Output Format

The output should be a real number, rounded to two decimal places, indicating the area of land in the farm where crops can grow.

Sample Input and Output

Sample Input #1

10 10
90.0
1
5 5 10 5

Sample Output #1

21.46

Sample Input #2

8 8
90.0
1
4 4 10 5

Sample Output #2

1.81

Sample Input #3

20 10
45.0
2
5 0 5 5
8 6 14 6

Sample Output #3

130.15

Notes

Time limit: 1 second, Memory limit: 64MB. This problem is from the 4th Lanqiao Cup National Finals in 2013.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10 10 90.0 1 5 5 10 5
样例输出
21.46