Buttons

AtCoder
IDabc124_a
Time2000ms
Memory256MB
Difficulty
There are two buttons, one of size $A$ and one of size $B$. When you press a button of size $X$, you get $X$ coins and the size of that button decreases by $1$. You will press a button twice. Here, you can press the same button twice, or press both buttons once. At most how many coins can you get? ## Constraints * All values in input are integers. * $3 \leq A, B \leq 20$ ## Input Input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
5 3
Output #1
9

You can get $5 + 4 = 9$ coins by pressing the button of size $5$ twice, and this is the maximum result.
Input #2
3 4
Output #2
7
Input #3
6 6
Output #3
12
API Response (JSON)
{
  "problem": {
    "name": "Buttons",
    "description": {
      "content": "There are two buttons, one of size $A$ and one of size $B$. When you press a button of size $X$, you get $X$ coins and the size of that button decreases by $1$. You will press a button twice. Here, yo",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc124_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are two buttons, one of size $A$ and one of size $B$.\nWhen you press a button of size $X$, you get $X$ coins and the size of that button decreases by $1$.\nYou will press a button twice. Here, yo...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments