编程介的小学生 2017-03-17 01:07 采纳率: 20.5%
浏览 654
已采纳

Herding Frosh

One day, a lawn in the centre of campus became infested with Frosh. In an effort to beautify the campus, one of our illustrious senior classmen decided to round them up using a length of pink silk. Your job is to compute how much silk was required to complete the task.
The senior classman tied the silk to a telephone post, and walked around the perimeter of the area containing the Frosh, drawing the silk taught so as to encircle all of them. He then returned to the telephone post. The senior classman used the minimum amount of silk necessary to encircle all the frosh plus one extra metre at each end to tie it.
You may assume that the telephone post is at coordinates (0,0), where the first dimension is North/South and the second dimension is East/West. The coordinates of the Frosh are given in metres relative to the post. There are no more than 256 Frosh.

Input

The input consists of a line specifying the number of Frosh, followed by one line per Frosh with two real numbers indicating his or her position.

Process to the end of file.

Output

The output for each case consists of a single number - the length of silk in metres, to two decimal places.

Sample Input

4
1.0 1.0
-1.0 1.0
-1.0 -1.0
1.0 -1.0

Sample Output

10.83

  • 写回答

1条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效