The Coin God Geonmo
Time limit1sMemory limit1024 MB
Given a principal N and a loss percentage X, find the percentage rise needed from the reduced amount to return exactly to N.
- Level
Easy2 of 10
- Topics
- Math
- Solved
- No attempts yet
Problem
Morgan lost of the principal on coins, so Morgan went to Geonmo, the coin god who can change coin prices however he wants. Geonmo is known for granting only one conscientious request in a lifetime. Morgan asked him to raise the current coin price by so that the principal is recovered exactly. However, Morgan overlooked one fact. If the price drops below the principal and then rises from that lower price, it does not return to the principal.
For example, suppose the principal is 100 won and . After losing , the value becomes 90 won. A further rise brings it to 99 won.
Help the careless Morgan recover the principal by finding the percentage that the current amount must rise, relative to the current amount.
Input
The first line contains an integer , the principal Morgan had. The second line contains an integer , the percentage Morgan lost.
Output
Print the answer on the first line. The answer is correct if its absolute or relative error from the true answer is at most .