#P4750. [CERC2017] Lunar Landscape
[CERC2017] Lunar Landscape
题目描述
A satellite is surveying a possible rover landing area on the moon. The landing area is modeled as a square grid embedded in the standard coordinate system.
The satellite has taken photos, each capturing a square area of the surface. Careful camera calibration has ensured that all photos are aligned with the grid — all four vertices have integer coordinates. Due to the satellite’s changing orbit there are two types of photos:
- Photos of type
Ahave sides that are parallel to coordinate axes. Such a photo is specified by giving the integer coordinates of the square’s middle point and the length of its side — always an even integer. - Photos of type
Bhave sides at a angle to the coordinate axes. Such a photo is specified by giving the integer coordinates of the square’s middle point and the length of its diagonal — always an even integer.
Find the total surface area captured in the satellite photos.
输入格式
The first line contains an integer — the number of photos. The of the following lines is either of the form “” or “” representing a photo of type A or B,respectively.
The and are the integer coordinates of the middle point of the photo . The and are even integers — the side length and the diagonal length, respectively.
输出格式
Output a number with exactly two digits after the decimal point — the total area of the surface. The answer has to exactly correspond to the judge’s solution (no rounding errors are tolerated).
2
A 0 0 2
B 1 0 2
5.00
8
A -7 10 4
B 3 10 8
A -6 6 6
A -2 5 8
B 3 -1 8
B -7 -4 8
A 3 9 2
B 8 6 6
205.50