Payment

AtCoder
IDabc173_a
Time2000ms
Memory256MB
Difficulty
We will buy a product for $N$ yen (the currency of Japan) at a shop. If we use only $1000$\-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. ## Constraints * $1 \leq N \leq 10000$ * $N$ is an integer. ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
1900
Output #1
100

We will use two $1000$\-yen bills to pay the price and receive $100$ yen in change.
Input #2
3000
Output #2
0

We can pay the exact price.
API Response (JSON)
{
  "problem": {
    "name": "Payment",
    "description": {
      "content": "We will buy a product for $N$ yen (the currency of Japan) at a shop. If we use only $1000$\\-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills requi",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc173_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We will buy a product for $N$ yen (the currency of Japan) at a shop.\nIf we use only $1000$\\-yen bills to pay the price, how much change will we receive?\nAssume we use the minimum number of bills requi...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments