Train

AtCoder
IDabc107_a
Time2000ms
Memory256MB
Difficulty
There is an $N$\-car train. You are given an integer $i$. Find the value of $j$ such that the following statement is true: "the $i$\-th car from the front of the train is the $j$\-th car from the back." ## Constraints * $1 \leq N \leq 100$ * $1 \leq i \leq N$ ## Input Input is given from Standard Input in the following format: $N$ $i$ [samples]
Samples
Input #1
4 2
Output #1
3

The second car from the front of a $4$\-car train is the third car from the back.
Input #2
1 1
Output #2
1
Input #3
15 11
Output #3
5
API Response (JSON)
{
  "problem": {
    "name": "Train",
    "description": {
      "content": "There is an $N$\\-car train. You are given an integer $i$. Find the value of $j$ such that the following statement is true: \"the $i$\\-th car from the front of the train is the $j$\\-th car from the back",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc107_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There is an $N$\\-car train.\nYou are given an integer $i$. Find the value of $j$ such that the following statement is true: \"the $i$\\-th car from the front of the train is the $j$\\-th car from the back...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments