<PREV Problem:
NEXT>
Solved by 197 users: ...
UserDateAttemptTimeCMSC
Fat25 jan 2009C++1800.01193 
Fat25 jan 2009C++1900.01194 
Fat25 jan 2009C++1700.01201 
Council19 oct 2006C++100.03202 
Fat25 jan 2009C++1500.01211 
Fat25 jan 2009C++1400.01215 
abortmozga.ru30 mar 2009C++2000.01235 
Jacob29 sep 2006C++600.02241 
abortmozga.ru30 mar 2009C++1700.01242 
zmy14 apr 2006C++600.02242 
shura29 apr 2004Python100.07242 
tourist07 nov 2007Kylix200.01245 
abortmozga.ru30 mar 2009C++1600.01245 
abortmozga.ru30 mar 2009C++1900.01246 
tiabaldu10 apr 2015Python100.06246 
abortmozga.ru30 mar 2009C++1800.01248 
DAV10 jul 2009C++900.01249 
Crazy-EyE06 oct 2006C++100.01250 
Languages
C++
113
FPC
40
Kylix
19
C
18
Java
5
Ruby
3
Python
2
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

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 180ms

SW soft NIX
ID = 35.168.111.191