Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 100 点
問題文
スーパー高橋は、牛肉 1 パック X g を Y 円で売っています。
スーパーすぬけは、スーパー高橋より 1 g あたりの価格が安くなるように牛肉を売り出すことにしました。
スーパーすぬけでは、牛肉 1 パックは Z g です。スーパー高橋より 1 g あたりの価格が真に安くなるような、最大の販売価格 (非負整数) は何円ですか?
制約
- 入力は全て整数
- 1 ≤ X, Y, Z ≤ 10^3
入力
入力は以下の形式で標準入力から与えられる。
X Y Z
出力
答えを出力せよ。
入力例 1
100 200 100
出力例 1
199
どちらのスーパーでも 1 パック 100 g なので、スーパーすぬけはスーパー高橋より 1 円安く売れば良いです。
入力例 2
103 971 593
出力例 2
5590
スーパー高橋の 1 g あたりの価格は \frac{971}{103} = 9.4271\dots 円/g です。スーパーすぬけは、牛肉 593 g を 5590 円で売ると 1 g あたりの価格が \frac{5590}{593} = 9.4266\dots 円/g になります。
入力例 3
1000 1 1
出力例 3
0
販売価格が 0 円になっても構いません。
Score : 100 points
Problem Statement
A Supermarket Takahashi sells an X-gram beef pack for Y yen.
Another Supermarket Snuke has decided to sell a beef pack at a lower price per gram.
In Snuke, one beef pack weighs Z grams. What is the greatest possible price (a non-negative integer) for Snuke's beef pack such that it is strictly cheaper than Takahashi's beef pack per gram?
Constraints
- All values in input are integers.
- 1 ≤ X, Y, Z ≤ 10^3
Input
Input is given from Standard Input in the following format:
X Y Z
Output
Print the answer.
Sample Input 1
100 200 100
Sample Output 1
199
Both stores sell 100-gram packs, so Snuke can just make it one yen cheaper than that in Takahashi.
Sample Input 2
103 971 593
Sample Output 2
5590
Takahashi sells beef for \frac{971}{103} = 9.4271\dots yen per gram. Snuke can sell 593 grams of beef for 5590 yen to make it \frac{5590}{593} = 9.4266\dots yen per gram.
Sample Input 3
1000 1 1
Sample Output 3
0
The price is allowed to be 0 yen.