시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 55 | 42 | 40 | 78.431% |
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 exchange rates.
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 ith 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.
3 300 150 200
200.00
4 100 200 400 100
400.00
5 400 300 500 300 250
266.66