Find Multiple

AtCoder
IDabc220_a
Time2000ms
Memory256MB
Difficulty
Print a number between $A$ and $B$ (inclusive) that is a multiple of $C$. If there is no such number, print `-1`. ## Constraints * $1 \leq A \leq B \leq 1000$ * $1 \leq C \leq 1000$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $A$ $B$ $C$ [samples]
Samples
Input #1
123 456 100
Output #1
200

`300` or `400` would also be accepted.
Input #2
630 940 314
Output #2
\-1
API Response (JSON)
{
  "problem": {
    "name": "Find Multiple",
    "description": {
      "content": "Print a number between $A$ and $B$ (inclusive) that is a multiple of $C$. If there is no such number, print `-1`.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc220_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Print a number between $A$ and $B$ (inclusive) that is a multiple of $C$.\nIf there is no such number, print `-1`.\n\n## Constraints\n\n*   $1 \\leq A \\leq B \\leq 1000$\n*   $1 \\leq C \\leq 1000$\n*   All valu...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments