eolymp
bolt
Try our new interface for solving problems
Problems

Hippogriffs

Hippogriffs

\includegraphics{https://static.e-olymp.com/content/b1/b16d03f14b49ad1b28e16302efcee8a3de7721ab.jpg} About twenty years ago, the dispute concerning the danger of hippogriffs was over at last. The Ministry of Magic issued a decree ordering the calculation of a hippogriff's danger according to the formula , where \textbf{A} is the length of the hippogriff's beak and \textbf{B} is the length of its claws. One farmer in the north of England bred hunter hippogriffs, but always had trouble finding customers. A kind wizard advised the farmer to buy a mutation elixir, which could make hippogriffs look more dangerous (then the creature would be more suitable for hunting). The farmer bought the elixir at a local magic shop and used it on his stock. He found that if a hippogriff of nonzero danger whose beak was \textbf{A} in length and claws were \textbf{B} in length drank the elixir, the length of its beak became \textbf{a_1A + b_1B} and the length of its claws became \textbf{a_2A + b_2B}. The quality of an elixir is the maximal influence of this elixir on a hippogriff (any hippogriff, and not only those at the farm), and the influence of an elixir on a hippogriff is the factor by which the danger of this hippogriff increases after the mutation. The farmer suspects that the salesman cheated him by selling an elixir of lower quality than usual. He wants to calculate the quality of an elixir using parameters \textbf{a_1}, \textbf{b_1}, \textbf{a_2}, \textbf{b_2}. \InputFile The first line contains the integers \textbf{a_1} and \textbf{b_1}. The second line contains the integers \textbf{a_2} and \textbf{b_2}. The parameters are nonnegative and don't exceed \textbf{10^6}. \OutputFile Output the quality of the elixir with the given parameters accurate to \textbf{9} fractional digits.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1 2
3 4
Output example #1
5.46498570421904260000
Author Igor Chevdar
Source XIII Open USU Championship