QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#15401. Birthday

الإحصائيات

Anon 和 Soyo 是好朋友。为了庆祝 Anon 的生日,Soyo 决定买一个蛋糕。经过精心挑选,她选了一个圆形的草莓蛋糕,准备带回家和 Anon 一起分享。

这个蛋糕被建模为一个以原点 $(0, 0)$ 为圆心、半径为 $r$ 的圆。蛋糕上有 $n$ 颗草莓,其中第 $i$ 颗草莓位于 $(x_i, y_i)$。任何草莓到原点的距离都不超过 $0.9r$。

Soyo 想要用一条直线将蛋糕切成两块。由于 Anon 很喜欢草莓,Soyo 希望 Anon 的那块蛋糕包含所有的草莓。如果某颗草莓恰好在切割线上,Soyo 可以将其分配给任意一块。

Soyo 希望使较小的那块蛋糕的面积尽可能大。请帮助 Soyo 计算在所有草莓都位于同一块蛋糕上的前提下,较小的那块蛋糕的最大可能面积。

输入格式

第一行包含两个整数 $n$ 和 $r$,分别表示蛋糕上草莓的数量和蛋糕的半径。

接下来的 $n$ 行中,第 $i$ 行包含两个整数 $x_i$ 和 $y_i$,表示第 $i$ 颗草莓的坐标。

  • $1 \le n \le 2 \times 10^5$
  • $1 \le r \le 10^6$
  • $\sqrt{x_i^2 + y_i^2} \le 0.9r$
  • 所有草莓的位置互不相同。

输出格式

输出一行一个实数,表示在所有草莓都位于同一块蛋糕上的前提下,较小的那块蛋糕的最大可能面积。

如果你的答案与标准答案的绝对误差或相对误差不超过 $10^{-6}$,则视为正确。形式化地,设你的答案为 $a$,标准答案为 $b$,若满足 $\frac{|a-b|}{\max(1,|b|)} \le 10^{-6}$,则你的答案被视为正确。

样例

输入 1

4 5
-3 -3
3 -3
-3 3
3 3

输出 1

11.182380450040

输入 2

7 15
9 -4
2 -2
8 3
0 4
-6 10
6 6
3 5

输出 2

353.429173528852

输入 3

15 15
-4 -1
0 -1
2 -9
0 2
8 1
3 -3
-9 3
8 6
9 7
-9 -1
2 6
-2 7
-10 -8
4 0
-5 -8

输出 3

168.906562205067

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.