<PREV Problem:
NEXT>
Solved by 197 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

The optimal path

Time limit = 2 seconds

Memory limit = 8 Mb

Peter is at the point A of primeval forest. He wants to reach point B in the fastest way. There is a straight path in the forest. Peter can go through the forest with a speed of 5 km/h, and through the path with a speed of 5*sqrt(2) km/h. You are to calculate the time, it will take Peter to get the point B.

Input Input contains 8 numbers, separated with spaces and new lines. They are the co-ordinates of the points A и B and the co-ordinates of the two different points of the path.

XA YA XB YB
X1 Y1 X2 Y2
All the numbers are not greater than 1000

Output The time in hours with two digits accuracy.

Input#1
0 1 0 -1
-1 0 1 0
Output#1
0.40

Author:
Barsky Eugene, IV MIPT Olympiad
11 april 2004

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 200ms

SW soft NIX
ID = 23.20.13.165