Dave somehow acquired exchange rates of US dollar to German marks for several days in the future. Write a program that will suggest Dave when to buy or sell marks or dollars so that, starting with 100 dollars he ends up with the highest possible amount of dollars at the end of the last day.
The first line of input file contains a natural
number N, 1 <=N <=100, the number of future days for which Dave knows
Each of N following lines contains a natural number A, 1 <=A <=100. Number A in the (i+1)th line denotes the medium exchange rate of i th day in advance. It tells Dave that on that day he will be able to either buys A marks for 100 USD or buy 100 USD for A marks.
The first and only line of output file should contain
a desired amount written to two decimal places.
Remark: Due to real arithmetic round off errors, results within error of 0.05 marks of correct value will be regarded as correct.
Explanation (needs not to be printed)
Day 1 ... changing 100.0000 USD = 400.0000 DEM
Day 2 ... changing 400.0000 DEM = 133.3333 USD
Day 3 ... changing 133.3333 USD = 666.6666 DEM
Day 5 ... changing 666.6666 DEM = 266.6666 USD