루미 알고리즘

#1557골드Inflation

PO 2023 결선코딩출제 Johan Sannemo영어 원문이 문제가 어렵다면 — 배우는 순서 보기

영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)

Problem

A large part of the economy is influenced by the prevailing inflation, i.e., how quickly prices of goods in society are rising. For example, the level of inflation affects how the Riksbank sets its policy rate, which in turn impacts the stock market, mortgage rates, and so on. Inflation is measured in percentage, indicating how much prices have increased compared to the same time last year.

In Sweden, the agency Statistics Sweden (SCB) measures the rate of inflation in society. They calculate the inflation rate each month by measuring how the inflation rate changes every day during the month and then summing up all the daily increases. You would like to use these figures to know if you should buy or sell all your stocks before SCB releases the figures officially. Luckily, you have a friend who is willing to leak the figures to you.

One problem is that your friend has been quite inconsistent with his notes. Sometimes he has recorded the daily change in the inflation rate in percentage points and sometimes in percent. If the inflation rate was 20% and the recorded increase was “50”, you do not know if the new inflation rate is 70% (an increase of 50 percentage points) or 30% (an increase of 50 percent).

At the very least, you can calculate an upper limit on the inflation rate, which might help your stock trading somewhat. What is the highest possible inflation rate, given your friend's data?

Input

The first line of input contains a decimal number I, the inflation rate in percent at the beginning of the month. This is followed by a line with 30 new decimal numbers, the changes in the inflation rate that your friend has recorded during the month.

All numbers are between 0 and 1000 and have at most 2 decimal places.

Output

Print a decimal number: the highest possible inflation rate. Your answer is considered correct if it has a relative or absolute error of at most 10^-6.

Scoring

Your solution will be tested on a set of test groups, each worth a number of points. Each test group contains a set of test cases. To get the points for a test group you need to solve all test cases in the test group.

GroupPointsConstraints
155Your friend has written down all increases in percentage points.
245No additional constraints.

예제

예제 1

입력
0
8 3 6 2 3 3 1 1 4 5 1 1 5 8 7 3 2 1 3 3 1 0 5 4 2 7 4 8 9 9
출력
119.9981000000

출처 표기

출처: Programmeringsolympiaden 2023년 결선 · 원문 페이지 · 이용 조건 CC BY-SA · LaTeX 원문을 화면용 글로 옮겼습니다(수식·표의 모양이 다를 수 있습니다). 내용은 고치지 않았습니다.

크리에이티브 커먼즈 저작자표시-동일조건변경허락.

문제 출처: 한국정보올림피아드(KOI) (CC BY-NC-SA 4.0) · International Olympiad in Informatics (IOI) (CC BY) · Centre for Education in Mathematics and Computing (CEMC), University of Waterloo (CC BY-NC 4.0) · Programmeringsolympiaden (CC BY-SA) · CSES Problem Set (Antti Laaksonen) (CC BY-NC-SA 4.0). 루미 알고리즘은 위 단체들과 관계없는 별도의 서비스이며, 자료는 원문 그대로 싣습니다. 문제마다 출처와 이용 조건을 따로 표기합니다.