编程介的小学生 2017-10-02 05:10 采纳率: 20.5%
浏览 953
已采纳

RoBa Has a Second Art Gallery!

Description

One year and a half after owning his first art gallery, RoBa has recently built his second art gallery. Just like before, in order to protect his cherished artworks from theft, he has hired security guards. In addition, He wants to install one or two surveillance cameras so that he can watch by himself day and night everything happening inside the gallery.

RoBa is reusing his plan of camera monitoring which has proved working with his first gallery. The gallery has a nice shape of a convex polygon. (Different from that of his first gallery, this polygon may not have cocircular vertices.) Tall and opaque walls stand on the edges of the polygon. A camera can be installed anywhere inside the gallery hanging from the ceiling or on the walls. A single camera’s sight is an infinite wedge emanating from the place the camera is installed and not blocked by any walls. The cameras are fixed. Once installed, they cannot move or rotate themselves.

The cost of having a camera installed is proportional to the angle spanned by the wedge the camera covers. RoBa wants to minimize the cost of his monitoring plan. Given the shape of the gallery, how should the camera(s) be installed?

In the illustration to the left (not describing the sample test case), two cameras should be installed at points A and C covering wedges α and β respectively. The cost can be measured by the sum of ∠CAD and ∠ACB.
Input

The input consists of a single test case. The first line contains an integer n (3 ≤ n ≤ 100), indicating that he polygon has n vertices. Each of the next n lines contains a pair of real numbers xi, yi, the coordinates of the i-th vertex. The vertices are listed in counterclockwise order. Any three of them are not collinear.

Output

Output the sum of angles spanned by the camera(s) in radians. A special checker program that admits an absolute error of 10−6 is used to verify your answer.

Sample Input

4
0 0
1 0
1 1
0 1
Sample Output

1.5707963267949

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-10-17 17:10
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器