DOLLARS | 프로그래밍의 벗 PivotOJ
PivotOJ

DOLLARS

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2001 Regional Competition - SeniorsBOJ 3279

문제

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.

예제

예제 1

입력
3
300
150
200
출력
200.00

예제 2

입력
4
100
200
400
100
출력
400.00

예제 3

입력
5
400
300
500
300
250
출력
266.66
코드를 제출하려면 로그인하세요.