编程介的小学生 2017-08-27 13:06 采纳率: 20.5%
浏览 579
已采纳

Ribbon Gymnastics

Robert is a gymnastics coach. Unfortunately, he got four gymnastics beginners to attend the coming competition. Since the competition has a nice award, Robert will make all his effort to win the competition.

One performance requires that each of the four player should take a ribbon and rotate herself, and assume the ribbons will then straighten out. Since Robert's four players are beginners, Robert cannot control the actual rotating speeds of four players during the competition. And when two ribbons touch, they may wind, which will cause players felling down. For safety, Robert should avoid this. Four distinct points will be given as xi yi before the competition begins. Players should stand at those points when rotating.

The longer the ribbons are, the more bonus Robert will gain. After knowing the four points Robert can choose ribbons and points for each player. The length of each ribbon should be positive. So help Robert to find the maximal total lengths of the four ribbons.

Input

There will be multiple test cases.Please process to the end of input.

Each test case contains four lines.

Each line contains two integers xi (-10^8≤xi≤10^8) and yi (-10^8≤yi≤10^8).

Output

Output the total maximal sum of the lengths of the four ribbons. Answer having an absolute or relative error less than 1e-6 will be accepted.

Sample Input

0 0
0 3
4 0
4 3
Sample Output

6.00000000

  • 写回答

1条回答

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

报告相同问题?

悬赏问题

  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的