P10703 [SNCPC2024] Window Flowers
Description
There is a $100 \text{cm} \times 100 \text{cm}$ window and $n$ square window flowers, each with diagonal length $2 \text{cm}$. Set up a coordinate system with the lower-left corner of the window as the origin $(0,0)$ and the upper-right corner as $(100,100)$. The center of the $i$-th window flower is pasted at an interior integer-coordinate point $(x_i,y_i)$ ($1 \leq x_i,y_i \leq 99$), 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 $n$ ($1 \leq n \leq 10000$).
The next $n$ lines each contain two integers $x_i,y_i$ ($1 \leq x_i,y_i \leq 99$), 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 $10^{−4}$. Formally, suppose your answer is $a$ and the standard answer is $b$. Your answer is considered correct if and only if $\frac{|a−b|}{\max (1,|b|)} \leq 10^{−4}$.
Explanation/Hint
For the explanation of the first sample, see the figure:

Translated by ChatGPT 5