#P10703. [SNCPC2024] 窗花

    ID: 12147 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>模拟2024Special JudgeO2优化陕西XCPC

[SNCPC2024] 窗花

Problem Description

There is a 100cm×100cm100 \text{cm} \times 100 \text{cm} window and nn square window flowers, each with diagonal length 2cm2 \text{cm}. Set up a coordinate system with the lower-left corner of the window as the origin (0,0)(0,0) and the upper-right corner as (100,100)(100,100). The center of the ii-th window flower is pasted at an interior integer-coordinate point (xi,yi)(x_i,y_i) (1xi,yi991 \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 nn (1n100001 \leq n \leq 10000).

The next nn lines each contain two integers xi,yix_i,y_i (1xi,yi991 \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 10410^{−4}. Formally, suppose your answer is aa and the standard answer is bb. Your answer is considered correct if and only if abmax(1,b)104\frac{|a−b|}{\max (1,|b|)} \leq 10^{−4}.

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