Competition

AtCoder
IDjsc2021_a
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
100 200 100
Output #1
199

Both stores sell $100$\-gram packs, so Snuke can just make it one yen cheaper than that in Takahashi.
Input #2
103 971 593
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.
Input #3
1000 1 1
Output #3
0

The price is allowed to be $0$ yen.
API Response (JSON)
{
  "problem": {
    "name": "Competition",
    "description": {
      "content": "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.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "jsc2021_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A Supermarket _Takahashi_ sells an $X$\\-gram beef pack for $Y$ yen.  \nAnother Supermarket _Snuke_ has decided to sell a beef pack at a lower price per gram.  \nIn Snuke, one beef pack weighs $Z$ grams....",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments