Олимпиадный тренинг

Задача 38357. Currency fraud


Petya, studying how the exchange rate of the ruble changes against the dollar and the euro, deduced the law according to which these changes take place (or thinks he has deduced it). According to this law, Petya calculated what the exchange rate of the ruble would be against the dollar and the euro in the next N days.

Petya has 100 rubles. On each day, he can exchange currencies for each other at the current rate without limiting the number (at the same time, the dollar exchange rate against the euro corresponds to the value that can be obtained by exchanging the dollar for rubles, and then these rubles — for euros). Since Petya will operate not with cash currency, but with a bank account, he can perform exchange operations with any (including non-integer) number of units of any currency.

Write a program that calculates the maximum number of rubles Petya can get by the end of the N-th day.

The laws of rate changes are arranged in such a way that during the specified period the ruble equivalent of the amount that Petya may have will not exceed 108 rubles.

Input
The first line of the input file contains one number N (1≤N≤5000). Each of the next N lines contains 2 numbers calculated according to Peter's laws for the corresponding day — how many rubles will cost 1 dollar, and how many rubles will cost 1 euro. All these values ​​are not less than 0.01 and not more than 10000. The values ​​are specified exactly and are expressed as real numbers with no more than two decimal places.

Imprint
In the output file, output the desired value with an accuracy of at least two decimal places.
 
Examples
# Input Output
1 1
30.00 9999.99
100.00