CF154E.Martian Colony

NOI/NOI+/CTSC

通过率:0%

时间限制:4.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first ship with the Earth settlers landed on Mars. The colonists managed to build n necessary structures on the surface of the planet (which can be regarded as a plane, and the construction can be regarded as points on it). But one day the scanners recorded suspicious activity on the outskirts of the colony. It was decided to use the protective force field generating system to protect the colony against possible trouble.

The system works as follows: the surface contains a number of generators of the field (they can also be considered as points). The active range of each generator is a circle of radius r centered at the location of the generator (the boundary of the circle is also included in the range). After the system is activated, it stretches the protective force field only over the part of the surface, which is within the area of all generators' activity. That is, the protected part is the intersection of the generators' active ranges.

The number of generators available to the colonists is not limited, but the system of field generation consumes a lot of energy. More precisely, the energy consumption does not depend on the number of generators, but it is directly proportional to the area, which is protected by the field. Also, it is necessary that all the existing buildings are located within the protected area.

Determine the smallest possible area of the protected part of the surface containing all the buildings.

第一艘载有地球殖民者的飞船降落在火星上。殖民者们成功地在该星球表面(可视为一个平面,而建筑可视为平面上的点)建造了 nn 个必要设施。但某日,扫描仪在殖民地外围记录到可疑活动。于是决定启用防护力场生成系统,以保护殖民地免受潜在威胁。

该系统工作方式如下:地表上布设若干力场发生器(亦可视为平面上的点)。每个发生器的有效作用范围是以其所在位置为圆心、半径为 rr 的圆(圆周本身也包含在作用范围内)。系统启动后,仅在所有发生器作用范围的公共交集区域内展开防护力场。即,受保护区域即为所有发生器有效作用范围的交集。

殖民者可用的发生器数量不受限制,但力场生成系统能耗巨大。更准确地说,能量消耗与发生器数量无关,而与力场所保护的面积成正比。此外,所有现有建筑必须完全位于受保护区域内。

请确定能够覆盖全部建筑的最小可能的受保护区域面积。

输入格式

The first line contains two integers n and r (1 ≤ n ≤ 105, 1 ≤ r ≤ 50000) — the number of buildings and the active ranges of the generators, correspondingly.

Next n lines contains the buildings' coordinates. The i + 1-th (1 ≤ i ≤ n) line contains two real numbers with at most three digits after the decimal point x__i and y__i (|x__i|, |y__i| ≤ 50000) — coordinates of the i-th building. It is guaranteed that no two buildings are located at the same point, and no two different buildings are located closer than 1.

It is guaranteed that there exists a circle with radius r that contains all the buildings.

第一行包含两个整数 nn 和 rr(1 ≤ n ≤ 1051 \le n \le 10^5,1 ≤ r ≤ 500001 \le r \le 50000)——分别表示建筑物的数量和发电机的有效作用半径。

接下来的 nn 行描述各建筑物的坐标。第 i+1i+1 行(1 ≤ i ≤ n1 \le i \le n)包含两个实数 xix_i 和 yiy_i(小数点后至多三位),满足 ∣xi∣, ∣yi∣ ≤ 50000|x_i|, |y_i| \le 50000——表示第 ii 座建筑物的坐标。保证不存在两座建筑物位于同一点,且任意两座不同建筑物之间的距离不小于 11。

保证存在一个半径为 rr 的圆,能够覆盖所有建筑物。

输出格式

Print the single real number — the minimum area of the protected part containing all the buildings. The answer is accepted if absolute or relative error doesn't exceed 10 - 4.

输出一个实数——包含所有建筑物的受保护区域的最小面积。若答案的绝对或相对误差不超过 10−410^{-4},则视为正确。

输入输出样例

  • 输入#1

    3 5
    0.00 0.000
    0.0 8.00
    6 8.00

    输出#1

    78.5398163397
  • 输入#2

    4 1000
    0.0 0.0
    0 2.00
    2.00 2
    2.0 0.00

    输出#2

    4.0026666140
  • 输入#3

    4 5
    3.00 0.0
    -3 0.00
    0.000 1
    0.0 -1.00

    输出#3

    8.1750554397

说明/提示

In the first sample the given radius equals the radius of the circle circumscribed around the given points. That's why the circle that corresponds to it is the sought area. The answer is 25π.

In the second sample the area nearly coincides with the square which has vertexes in the given points.

The area for the third sample is shown on the picture below.

在第一个样例中,给定的半径等于过给定点的外接圆半径,因此对应此半径的圆即为所求区域,答案为 25π25\pi。

在第二个样例中,该区域几乎与以给定点为顶点的正方形重合。

第三个样例对应的区域如下图所示。

输入解题思路,AI测评打分。不知道怎么写?

首页