QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 256 MB 總分: 100

#18179. 完全控制

统计

ByteCity 是 Byteland 的首都。它可以被描述为一个由墙壁包围的、拥有 $n$ 个顶点的凸多边形。

ByteCity 的市长决定升级该市军队所使用的武器。如果新枪支的射程为 $d$ ($d \ge 0$),那么市长会将城市内部的所有区域以及距离城墙不超过 $d$ 的所有区域都视为“忠诚区域”。

如果忠诚区域的面积至少为 $S$,市长的虚荣心就会得到满足。为了满足这一要求,他需要为军队购买的枪支的最小射程是多少?

输入格式

第一行包含两个整数 $n$ 和 $S$ ($3 \le n \le 5 \cdot 10^4$, $1 \le S \le 10^{13}$),分别表示城市多边形的顶点数和所需的忠诚区域面积。

接下来的 $n$ 行中,每行包含两个整数 $x$ 和 $y$ ($-10^6 \le x, y \le 10^6$),表示多边形顶点的坐标。

保证这 $n$ 个点是按逆时针顺序给出的凸多边形的顶点。

输出格式

输出一个实数,表示枪支的最小射程。如果你的答案的绝对误差或相对误差不超过 $10^{-6}$,则被视为正确。

样例

输入样例 1

4 2
0 0
1 0
1 1
0 1

输出样例 1

0.21402387849518847

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.