luogu#P1756. [NOI2009] 描边

    ID: 727 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>计算几何高精度2009NOI提交答案Special Judge二分图

[NOI2009] 描边

Background

Description

Xiao Z is an outstanding mathematician. Being clever, he especially enjoys studying small mathematical problems.

One day, he chose nn points on a sheet of paper and connected every pair with a pencil, forming n(n1)2\dfrac{n(n-1)}{2} segments. Since the pencil is very thin, we can consider these segments to have width 00.

Looking at these segments, Xiao Z fell into deep thought. He believed some of these segments were more important and needed emphasis. So he took out a brush and restroked them. When the brush touches the paper, it forms a disk of radius rr. While stroking a segment, the center of the brush (i.e., the center of the disk) starts from one endpoint and moves along the segment to the other endpoint. The figure below shows the result of emphasizing one segment in a configuration with 44 points.

Now, Xiao Z wants to know the total area on the paper that is emphasized after stroking. Can you help him answer this question?

Output Format

The output file path*.out contains exactly one line with one number, which is the total area emphasized after stroking.

2
1 1
1 2
1
1 2
1
0.00001 0.001 0.1 1

5.1415927

Hint

Each test point is scored independently.

This problem has 44 scoring parameters p1,p2,p3,p4p_1, p_2, p_3, p_4 (p1<p2<p3<p4p_1 \lt p_2 \lt p_3 \lt p_4), which are given in the input file.

Your score will be determined by the following rules:

  • If your answer differs from the standard answer by no more than p1p_1, you will receive full score for that test point.
  • Otherwise, if your answer differs from the standard answer by no more than p2p_2, you will receive 70%70\% of the score for that test point.
  • Otherwise, if your answer differs from the standard answer by no more than p3p_3, you will receive 40%40\% of the score for that test point.
  • Otherwise, if your answer differs from the standard answer by no more than p4p_4, you will receive 10%10\% of the score for that test point.
  • Otherwise, your score for that test point will be 00.

Translated by ChatGPT 5