SP1726 EXCHANGE - Exchange

Description

There are 3 kinds of money in a planet far away from the earth: Mone, Luck, and Rpin. There's a money exchange company in this planet. You must go to this company if you want to do some money exchange, and, more autocratically, this company regulate the exchange rate of each pair of these 3 kinds of money. The money exchange will be done in the following two ways: (A) You give the company a real number _x_ in the range (0,100\], the company will exchange _x_% of your Mone and _x_% of your Luck to equal Rpin according to the exchange rate of that day. (B) You give the company a real number _x_, the company will exchange your _x_ Rpin to some Mone and Luck, whose value is equal to _x_ Rpin according to the exchange rate of that day, and, the value of Mone is _Rate_ times of the value of Luck. You can do many exchange operations in the same day. Now, as the excellant spy in this planet, you know the exchange rate between Mone and Rpin of each of the next _n_ days(a $ _{i} $ Mone per Rpin), and the exchange rate between Luck and Rpin of each of the next _n_ days(b $ _{i} $ Luck per Rpin), and, each Rate of the next _n_ days( Rate $ _{i} $ ). you have _S_ Rpin in the start, and you want to get most Rpin in the _n_th day later.

Input Format

Multiple test cases, the number of them(

Output Format

For each test case, output one line contains a real number with 3 digits after decimal point, which denotes to the answer. You can assume it is less than 1000000000.