QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#15510. Inflation

统计

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}$.

Sample

Input

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

Output

119.9981000000

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.

Group Points Constraints
$1$ $55$ Your friend has written down all increases in percentage points.
$2$ $45$ No additional constraints.
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.