Harmony

AtCoder
IDabc135_a
Time2000ms
Memory256MB
Difficulty
We have two distinct integers $A$ and $B$. Print the integer $K$ such that $|A - K| = |B - K|$. If such an integer does not exist, print `IMPOSSIBLE` instead. ## Constraints * All values in input are integers. * $0 \leq A,\ B \leq 10^9$ * $A$ and $B$ are distinct. ## Input Input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
2 16
Output #1
9

$|2 - 9| = 7$ and $|16 - 9| = 7$, so $9$ satisfies the condition.
Input #2
0 3
Output #2
IMPOSSIBLE

No integer satisfies the condition.
Input #3
998244353 99824435
Output #3
549034394
API Response (JSON)
{
  "problem": {
    "name": "Harmony",
    "description": {
      "content": "We have two distinct integers $A$ and $B$. Print the integer $K$ such that $|A - K| = |B - K|$. If such an integer does not exist, print `IMPOSSIBLE` instead.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc135_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have two distinct integers $A$ and $B$.\nPrint the integer $K$ such that $|A - K| = |B - K|$.\nIf such an integer does not exist, print `IMPOSSIBLE` instead.\n\n## Constraints\n\n*   All values in input ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments