0030. Planet Lob

Имя входного файла: plob.in
Имя выходного файла: plob.out
Ограничение по времени: 2 s
Ограничение по памяти: 64 megabytes

Somewhere in the universe a planet called "Lob" is located. This planet is very strange. Its inhabitants consider the surface of their planet as a part of the plane with y coordinates greater than 0. Also the strangest property of this planet is that the velocity of any object moving on the surface of planet is equal to its y-coordinate in any moment. So the velocity will be constant only if y-coordinate is constant.

Inhabitants of the planet have built a car which automatically selects the fastest path between two points. So your task is to calculate the minimal amount of travelling time between two points on the surface.

Input file

The input file contains 4 integer numbers x1 y1 x2 y2 where all coordinates do not exceed 100000000 by absolute value. yi are guaranteed to be positive.

Output file

You have to output only one real number – time the car will travel from one point to another. The number must be written with 8 digits after the decimal point.

Examples:

plob.inplob.out
0 1 0 10.00000000


Источник: Petrozavodsk training camp, Summer 2002. Startup contest
Автор: Andrew Lopatin, Nick Durov

Обсудить       Отправить решение



Версия для печати