CF613A.Peter and Snow Blower

普及/提高-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Peter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. After reading the instructions he realized that it does not work like regular snow blowing machines. In order to make it work, you need to tie it to some point that it does not cover, and then switch it on. As a result it will go along a circle around this point and will remove all the snow from its path.

Formally, we assume that Peter's machine is a polygon on a plane. Then, after the machine is switched on, it will make a circle around the point to which Peter tied it (this point lies strictly outside the polygon). That is, each of the points lying within or on the border of the polygon will move along the circular trajectory, with the center of the circle at the point to which Peter tied his machine.

Peter decided to tie his car to point P and now he is wondering what is the area of the region that will be cleared from snow. Help him.

彼得在新年收到了一台新的扫雪机作为礼物。当然,彼得决定立刻试用它。在阅读说明书后,他意识到这台机器的工作方式与普通扫雪机不同:要使它工作,必须将它系在某个不被机器覆盖的点上,然后开机。结果,它将围绕该点作圆周运动,并清除其运动路径上的所有积雪。

形式化地,我们假设彼得的扫雪机是一个平面上的多边形。当机器启动后,它将围绕彼得将其系住的那个点(该点严格位于多边形外部)作圆周运动。也就是说,所有位于该多边形内部或边界上的点,都将沿着以彼得系住机器的点为圆心的圆形轨迹运动。

彼得决定将他的扫雪机系在点 PP 上,现在他想知道:最终被清除积雪的区域面积是多少?请帮助他。

输入格式

The first line of the input contains three integers — the number of vertices of the polygon n (), and coordinates of point P.

Each of the next n lines contains two integers — coordinates of the vertices of the polygon in the clockwise or counterclockwise order. It is guaranteed that no three consecutive vertices lie on a common straight line.

All the numbers in the input are integers that do not exceed 1 000 000 in their absolute value.

输入的第一行包含三个整数——多边形的顶点数 nn()以及点 PP 的坐标。

接下来的 nn 行中,每行包含两个整数——按顺时针或逆时针顺序给出的多边形各顶点的坐标。保证不存在三个连续的顶点共线。

输入中的所有数字均为整数,且其绝对值不超过 1 000 0001\,000\,000。

输出格式

Print a single real value number — the area of the region that will be cleared. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6.

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if .

输出一个实数——被清理区域的面积。只要你的答案的绝对误差或相对误差不超过 10−610^{-6},即视为正确。

具体而言:假设你的答案为 aa,评测组的标准答案为 bb。当且仅当 时,评测程序将判定你的答案正确。

输入输出样例

  • 输入#1

    3 0 0
    0 1
    -1 2
    1 2

    输出#1

    12.566370614359172464
  • 输入#2

    4 1 -1
    0 0
    1 2
    2 0
    1 1

    输出#2

    21.991148575128551812

说明/提示

In the first sample snow will be removed from that area:

在第一个样例中,积雪将从该区域被清除:

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

首页