No.928 Reduced Tax Rate?
タグ : / 解いたユーザー数 135
作問者 :
Problem Statement
K is at a certain ramen shop.
This shop sells ramen (before tax) priced at $1円,2円,3円,\dots,(10^9-1)円,10^9円$.
More precisely, ramen is sold at every positive integer price from $1$ yen to $10^9$ yen, inclusive.
This shop has two consumption tax rates, $P\%,\ Q\%$. For a ramen priced at $x$ yen, you must pay $\left \lfloor \left(1+\frac{P}{100}\right)x \right \rfloor$ yen when eating in the shop,
and $\left \lfloor \left(1+\frac{Q}{100}\right)x \right \rfloor$ yen when taking it out to eat
($\lfloor \cdot \rfloor$ means truncating the fractional part).
Furthermore, when taking it out, you apparently must pay a takeout container fee of $A$ yen in addition to the tax-included price of the ramen. No tax is charged on this container fee.
K wants to buy one ramen and eat it in the shop, and will choose one that satisfies the following condition.
- The total cost of eating in the shop is lower than the total cost of taking it home to eat.
Input
P Q A
The first line contains the tax rates $P,Q$ and the container fee $A$, separated by spaces.
Constraints
- $0 \le P,Q \lt 100$
- $0 \le A \le 10000$
- All inputs are integers.
Output
Output the total number of ramen K can choose among the $10^9$ kinds.
Print a newline at the end.
Sample
Sample 1
Input
20 0 10
Output
49
It turns out that the prices of ramen satisfying the condition are $1,2,...,49$ yen.
For example, for a ramen priced at $49$ yen,
eating in the shop costs $\left \lfloor \left(1+\frac{20}{100}\right)x \right \rfloor = 58$ yen,
and taking it home to eat costs $\left \lfloor \left(1+\frac{0}{100}\right)x \right \rfloor + 10 = 59円$. This satisfies the condition.
On the other hand, for a ramen priced at $50$ yen,
eating in the shop costs $\left \lfloor \left(1+\frac{20}{100}\right)x \right \rfloor = 60$ yen,
and taking it home to eat costs $\left \lfloor \left(1+\frac{0}{100}\right)x \right \rfloor + 10 = 60円$. This violates the condition.
Sample 2
Input
10 8 30
Output
1473
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。