#P10703. [SNCPC2024] 窗花
[SNCPC2024] 窗花
Problem Description
There is a window and square window flowers, each with diagonal length . Set up a coordinate system with the lower-left corner of the window as the origin and the upper-right corner as . The center of the -th window flower is pasted at an interior integer-coordinate point (), and the diagonal of the flower is parallel to the coordinate axes.
Find how much area of the window is covered by at least one window flower.
Input Format
The first line contains an integer ().
The next lines each contain two integers (), with the meaning as described above.
Output Format
Output one real number on a single line, the area covered by at least one window flower.
Your answer is considered correct if and only if its relative error or absolute error does not exceed . Formally, suppose your answer is and the standard answer is . Your answer is considered correct if and only if .
5
1 1
2 1
3 2
5 5
5 5
7.5
Hint
For the explanation of the first sample, see the figure:

Translated by ChatGPT 5