Consecutive Integers

AtCoder
IDdiverta2019_a
Time2000ms
Memory256MB
Difficulty
Snuke has $N$ integers: $1,2,\ldots,N$. He will choose $K$ of them and give those to Takahashi. How many ways are there to choose $K$ consecutive integers? ## Constraints * All values in input are integers. * $1 \leq K \leq N \leq 50$ ## Input Input is given from Standard Input in the following format: $N$ $K$ [samples]
Samples
Input #1
3 2
Output #1
2

There are two ways to choose two consecutive integers: $(1,2)$ and $(2,3)$.
Input #2
13 3
Output #2
11
API Response (JSON)
{
  "problem": {
    "name": "Consecutive Integers",
    "description": {
      "content": "Snuke has $N$ integers: $1,2,\\ldots,N$. He will choose $K$ of them and give those to Takahashi. How many ways are there to choose $K$ consecutive integers?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "diverta2019_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Snuke has $N$ integers: $1,2,\\ldots,N$. He will choose $K$ of them and give those to Takahashi.\nHow many ways are there to choose $K$ consecutive integers?\n\n## Constraints\n\n*   All values in input are...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments