题目链接:1325: Distance

Description

There is a battle field. It is a square with the side length 100 miles, and unfortunately we have two comrades who get hurt still in the battle field. They are in different positions. You have to save them. Now I give you the positions of them, and you should choose a straight way and drive a car to get them. Of course you should cross the battle field, since it is dangerous, you want to leave it as quickly as you can!

有一个战场。这是一个边长100英里的正方形,不幸的是我们还有两个同志在战场上受伤。他们处于不同的位置。你必须拯救他们。现在我给你它们的位置,你应该选择一条直线,然后开车去取它们。当然你应该穿过战场,因为它很危险,你想尽快离开它!

Input

There are many test cases. Each test case contains four floating number, indicating the two comrades’ positions (x1,y1), (x2,y2).

Proceed to the end of file.

有许多测试用例。每个测试用例包含四个浮点数,表示两个同志的位置 (x1, y1), (x2, y2) 。

继续到文件末尾。

Output

you should output the mileage which you drive in the battle field. The result should be accurate up to 2 decimals.

你应该输出你在战场上行驶的里程。结果应该精确到小数点后两位

Sample Input

1.0 2.0 3.0 4.0
15.0 23.0 46.5 7.0
0.0 0.0 100.0 0.0
100.0 0.0 100.0 100.0
0.0 0.0 100.0 100.0
0.0 100.0 100.0 0.0
20.0 5.0 40.0 20.0
30.0 30.0 80.0 90.0
20.0 12.0 40.0 34.0
30.0 80.0 70.0 20.0
40.0 70.0 80.0 30.0
40.0 75.0 60.0 50.0
20.0 15.0 40.0 10.0
20.0 70.0 50.0 85.0
10.0 44.0 30.0 52.0

Sample Output

140.01
67.61
100.00
100.00
141.42
141.42
108.33
130.17
135.15
120.19
127.28
128.06
82.46
89.44
107.70

HINT

The battle field is a square local at (0,0),(0, 100),(100,0),(100,100).

战场是一个位于 (0, 0),(0, 100),(100, 0),(100, 100) 的正方形。

分析

最新文章

  1. SharePoint 2013技巧分享系列 - 隐藏Blog和Apps左侧导航菜单
  2. Android first---xml文件生成与解析
  3. 结对实验报告-android计算器设计
  4. 存量数据处理结果查询.txt
  5. 在C++中定义常量的两种方法的比较
  6. DataGridView 改变行列颜色
  7. 超越css读书笔记
  8. elasticsearch高级组合查询ava
  9. hive中使用case、if:一个region统计业务(hive条件函数case、if、COALESCE语法介绍:CONDITIONAL FUNCTIONS IN HIVE)
  10. Lambda in Java VS in C#
  11. 拓展abaqus python 模块
  12. python模块详解
  13. mysql limit 性能问题分析
  14. (原)关于获取ffmpeg解析rtsp流sdp中带有sps,pps的情况
  15. Androidstudio_LinearLayout
  16. @PathVariable与@RequestBody的区别,及前段请求接口的写法。
  17. PTA 大炮打蚊子   (15分)
  18. Xcode 利用VVDocumenter 生成注释 通过设置 再生成注释文档
  19. Xbox360游戏收藏
  20. selenium 滚动条操作(JavaScript操作)

热门文章

  1. ftp配置 Laravel上传文件到ftp服务器
  2. 查看Linux系统的USB设备
  3. colock
  4. 【转载】 Bill Gates和Elon Musk推荐,人工智能必读的三本书 -《终极算法》,《超级智能》和《终极发明》
  5. windows使用pipenv创建虚拟环境报错UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 4: in...
  6. Spring cloud微服务安全实战-3-8API安全机制之Https
  7. ES6深入浅出-3 三个点运算 & 新版字符串-2. 新版字符串
  8. C++构造函数以及何时被调用
  9. Linux的桌面虚拟化技术KVM(一)——新建KVM虚拟机
  10. iOS App Store网址的命名规则