1033. Distance

时间限制 1000 ms   内存限制 32 MB

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!

输入数据

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.

输出数据

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

样例输入

复制
1.0 2.0 3.0 4.0
15.0 23.0 46.5 7.0
   ·   ·   ·   \n
    ·    ·    ·   \n

样例输出

复制
140.01
67.61
      \n
     \n

样例说明

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

提交

请先 登录

© 2024 FAQs Contact About