Currency Manipulations
Peter has been analyzing the fluctuations in the ruble exchange rate against the dollar and euro. Based on his observations, he believes he has discovered a pattern governing these changes. Using this pattern, Peter has predicted the ruble exchange rates for the dollar and euro over the next N days.
Peter starts with 100 rubles. Each day, he can exchange currencies freely according to the current rates, with no restrictions on the amount (the exchange rate between the dollar and euro is determined by converting a dollar to rubles and then those rubles to euros). Since Peter is using a bank account rather than physical cash, he can trade any amount, including fractional amounts, of any currency.
Your task is to write a program that determines the maximum amount of rubles Peter can have at the end of the N-th day.
The exchange rate changes are such that during this period, the ruble equivalent of Peter's potential final amount will not exceed 10^8 rubles.
Input
The input begins with a single integer N (1 ≤ N ≤ 5000). The next N lines each contain 2 numbers, representing the exchange rates for that day according to Peter's pattern: the cost in rubles of 1 dollar and the cost in rubles of 1 euro. Each value is at least 0.01 and at most 10000, provided as real numbers with up to two decimal places.
Output
Output the maximum amount of rubles Peter can achieve, formatted to two decimal places.