Problem:


Score : 100 points

Problem Statement

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

Output

Print the maximum number of coins you can get.

Sample Input 1

5 3

Sample Output 1

9

You can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.

Sample Input 2

3 4

Sample Output 2

7

Sample Input 3

6 6

Sample Output 3

12



Sample input:
5 3


Sample output:
9

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
print(max(2 * a - 1, 2 * b - 1, a + b - 1))

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())

if a >= b + 2:
    print(a + (a-1))
else:
    print(a + b)

Submission status: Wrong Answer

Solution code:
A, B = list(map(int,input().split()))

SUM = 0
for i in range(2):
  if A >= B:
    SUM = SUM + A
    A -= A
  else:
    SUM = SUM + B
    B -= B
  
print(SUM)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())

ans = 0

for i in range(2):
    if A > B:
        ans = ans + A
        A = A - 1
    else:
        ans = ans + B
        A = B - 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=max(a,b)
if(a!=b):
    print(a+a-1)
else:
    print(a+b)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
a=max(a,b)
print(a+a-1)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
num = max(a, b)
print(num + (num - 1))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
print(max(a + a - 1, a + b))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a==b:
  ans=a*2
else:
  ans=a*2-1
print(ans)

Submission status: Wrong Answer

Solution code:
def num_from_stdin():
    import sys
    return int(sys.stdin.readline())
def nums_from_stdin():
    import sys
    return [ int(num) for num in sys.stdin.readline().strip().split(' ')]

nums = nums_from_stdin()

num = max(nums)
print(num+(num-1))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a<b:
    print(2*a-1)
elif a==b:
    print(2*a)
else:
    print(2*b-1)

Submission status: Wrong Answer

Solution code:
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A-2)
else:
  print(2*B-1)

Submission status: Wrong Answer

Solution code:
button = map(int, input().split())
button_sort = sorted(button, reverse = True)
sum = button_sort[0]
button_sort[0] = button_sort[0] - 1
sum += button_sort[0]
print (sum)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

if abs(a - b) >1:
    print(max(a,b) + max(a,b)-1)
else :
    print(2*max(a,b))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

def Buttons(x, y):
  if x > y:
    return 2*x-1
  elif x < y:
    return 2*y-1
  elif x==y:
    return x+y


Buttons(a,b)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

def Buttons(x, y):
  if x > y:
    return 2*x+1
  elif x < y:
    return 2*y+1
  elif x==y:
    return x+y


Buttons(a,b)

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
c=max(x,y)
print(c*2-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
ans = 0
for i in range(0,2):
	if(a>=b):
		ans += a
		a-=1
	else:
		ans += b
		b-~1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)

def rec(n):
    if n == 1:
        return 1
    return rec(n-1) + 1


print(rec(600000))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)

def rec(n):
    if n == 1:
        return 1
    return rec(n-1) + 1


print(rec(700000))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)

def rec(n):
    if n == 1:
        return 1
    return rec(n-1) + 1


print(rec(500000))

Submission status: Wrong Answer

Solution code:
a,b=map(int, input().split())
print(max(a,b)+max(max(a-1,b),max(b-1,a)))

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
ret = 0

if x == y:
    ret = x + y
else:
    if x > y:
        ret = x
        x -= 1
    elif y > x:
        ret = y
        y -= 1

    if x > y:
        ret += x
        x -= 1
    elif y > x:
        ret += y
        y -= 1

print(ret)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
ret = 0

if x == y:
    ret = x + y
else:
    if x > y:
        ret = x
        x - 1
    elif y > x:
        ret = y
        y - 1

    if x > y:
        ret += x
        x - 1
    elif y > x:
        ret += y
        y - 1

print(ret)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
ret = 0

if x == y:
    ret = x + y
else:
    if x > y:
        ret = x
        x - 1
    elif y > x:
        ret = y
        y - 1

    if x > y:
        ret = x
        x - 1
    elif y > x:
        ret = y
        y - 1

print(ret)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

inputs = [A, B]
inputs.sort()

button1 = inputs[0]
inputs[0] -= 1
inputs.sort()

button2 = inputs[0]

print(button1 + button2)

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split()))
 
a = l[0]
b = l[1]

c = 0
if a <= b:
  c += b
  b -= 1
else:
  c += b
  b -= 1
 
if a <= b:
  c += b
  b -= 1
else:
  c += b
  b -= 1
  
print(c)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
C = 0
C += max(A,B)
C += max(C-1,A,B)
print(C)

Submission status: Wrong Answer

Solution code:
Hs = input().strip().split(' ')
ans = 0;
H = 0;
for i in Hs:
  i = int(i)
  if (i > H):
  	ans += 1
  H = max(H, i)

print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

ans = 0
if A == B:
    ans = A + B
else:
    tmp = A - B
    count = 0
    for ii in range(abs(tmp)):
        if tmp > 0:
            ans += A
            A -= 1
            count += 1
        elif tmp < 0:
            ans += B
            B -= 1
            count += 1
        if ii + 1 == abs(tmp):
            ans += A
            count += 1
        if count == 2:
            break
        
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split()) 
sum = 0

print(A)
print(B)

if A > B:
    sum = A + (A - 1)
elif B > A:
    sum = B + (B - 1)
else:  
    sum = A + B

print(sum)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split()) 
sum = 0

print(A)
print(B)

if A > B:
    sum = A + (A - 1)
if B > A:
    sum = B + (B - 1)
else:
    sum = A + B

print(sum)

Submission status: Wrong Answer

Solution code:
a,b=map(int, input().split()) 
max1 = max(a,b)
max2 = max(max(a,b), min(a,b)-1)

print(max1+max2)

Submission status: Wrong Answer

Solution code:
A, B = list(map(int, input().split()))

ans = A + B + 1

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
v1, v2 = map(int, input().split())

if v2 < 0:
    v2 = 0

if v1 < v2:
    t = v1
    v1 = v2
    v2 = t

v3 = v1 - v2

if v3 == 0:
    print(v1*2)

if v3 >= 2:
    print(v1*2-1)

if v1 == 1:
    print(v1*2+1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
v1, v2 = map(int, input().split())

if v1 < v2:
    t = v1
    v1 = v2
    v2 = t

v3 = v1 - v2

if v3 == 0:
    print(v1*2)

if v3 >= 2:
    print(v1*2-1)

if v1 == 1:
    print(v1*2+1)

Submission status: Wrong Answer

Solution code:
a, b= (int(i) for i in input().split())  
a=3
b=5

if a>=b:
    k=a
else:
    k=b

if a>=b:
    k=k+a
else:
    k=k+b

print(k)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B


MaxCoinCount(a, b)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
print(max(a-1+b,b-1+a,2*a-1,2*b-1))

Submission status: Wrong Answer

Solution code:
a, b = list(map(int, input().split()))
max(a + a - 1, b + b - 1, a + b)

Submission status: Wrong Answer

Solution code:
def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B + 1)
  else:
    ans = A + B

Submission status: Wrong Answer

Solution code:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
a,b=IL()
if a==b:
  print(a+b)
else:
  print(2*a-1)

Submission status: Wrong Answer

Solution code:
import numpy as np


x = input()
#入力の読み込み
a,b = map(int,x.split())

data = np.array([a, b, a-1, b-1])

X = np.sort(data)[::-1]
wa = X[0]+X[1]

Submission status: Wrong Answer

Solution code:
Tiles=input()
N_len=len(Tiles)
if N_len == 1:
    print("0")
    exit()
    
cur=Tiles[0]

change=0
for i in range(1, N_len):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change+=1

        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]

    #print("new cur={}".format(cur))

min_change = change


change_first=1
if Tiles[0] == "0":
    cur = "1"
else:
    cur = "0"

for i in range(1, N_len):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change_first+=1
        if min_change <= change_first:
            break

        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]
        
if min_change > change_first:
    min_change = change_first

        
change_reverse=0
cur=Tiles[N_len-1]
for i in reversed(range(0, N_len-1)):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change_reverse+=1
        if min_change <= change_reverse:
            break


        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]

    #print("new cur={}".format(cur))
    
if min_change > change_reverse:
    min_change = change_reverse


change_reverse_first=1
if Tiles[N_len-1] == "0":
    cur = "1"
else:
    cur = "0"

for i in reversed(range(0, N_len-1)):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change_reverse_first+=1
        if min_change <= change_reverse_first:
            break

        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]

if min_change > change_reverse_first:
    min_change = change_reverse_first

print(str(min_change))

Submission status: Wrong Answer

Solution code:
s = list(input())
N = len(s)
cont = 0
for i in range(1,N):
    if s[i-1]==s[i]:
        cont += 1
        if s[i] == '0':
            del s[i]
            s.insert(i, '1')          
        else:
            del s[i]
            s.insert(i, '0')    
print(cont)

Submission status: Wrong Answer

Solution code:
Tiles=input()
N_len=len(Tiles)
if N_len == 1:
    print("0")
    exit()
    
cur=Tiles[0]

change=0
for i in range(1, N_len):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change+=1

        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]

    #print("new cur={}".format(cur))

min_change = change


change_first=1
if Tiles[0] == "0":
    cur = "1"
else:
    cur = "0"

for i in range(1, N_len):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change_first+=1
        if min_change <= change_first:
            break

        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]
        
if min_change > change_first:
    min_change = change_first

        
change_reverse=0
cur=Tiles[N_len-1]
for i in reversed(range(0, N_len-1)):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change_reverse+=1
        if min_change <= change_reverse:
            break


        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]

    #print("new cur={}".format(cur))
    
if min_change > change_reverse:
    min_change = change_reverse


change_reverse_first=1
if Tiles[N_len-1] == "0":
    cur = "1"
else:
    cur = "0"

for i in reversed(range(0, N_len-1)):
    #print("i={}".format(i))
    #print("cur={}".format(cur))
    #print("next={}".format(Tiles[i]))
    if cur is Tiles[i]:
        change_reverse_first+=1
        if min_change <= change_reverse_first:
            break

        if Tiles[i] == "0":
            cur = "1"
        else:
            cur ="0"
    else:
        cur=Tiles[i]

if min_change > change_reverse_first:
    min_change = change_reverse_first

print(min_change)

Submission status: Wrong Answer

Solution code:
max1 = 0

for i in range(3,21):
    for j in range(3,21):
          A = i
          B = j
          if A >= B:
              a = A
              b = B
          else:
              a = B
              b = A
          if a == b:
              ans = 2*a
          elif a == b + 1:
              ans = a + b
          elif a >= b + 2:
              ans = 2*a - 1
          if max1 <= ans:
              max1 = ans
print(max1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
print(a+b) if a == b else print(b+b-1)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

ans = 0
for i in range(2):
    if A > B:
        ans += A
        A -= 1
    elif A < B:
        ans += B
        B -= 1
      
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a>=b:
  print(a+(a-1))
else:
  print(b+(b-1))

Submission status: Wrong Answer

Solution code:
max1 = 0

for i in range(3,21):
    A = i
    for j in range(3,21):
          B = j
          if A >= B:
              a = A
              b = B
          else:
              a = B
              b = A
          if a == b:
              ans = 2*a
          elif a == b + 1:
              ans = a + b
          elif a >= b + 2:
              ans = 2*a - 1
          if max1 <= ans:
              max1 = ans
print(max1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

if a >= b:
  x = a
  if (a-1) >= b:
    x += (a-1)
  else:
    x += b
else:
  x = b
  if (b-1) >= a:
    x += (b-1)
  else:
    x += a

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if a == b:
    print(a+b)
else:
    c = b-1
    print(b+c)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
result_a = a + a - 1
result_b = b + b - 1
result_a_b = a + b
if (result_a_b > result_a) and (result_a_b > result_b):
    print(result_a_b)
elif (result_a > result_b) and (result_a > result_a_b):
    print(result_a)
elif (result_b > result_a) and (result_b > result_a_b):
    print(result_b)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
result_a = a + a - 1
result_b = b + b - 1
result_a_b = a + b
if (result_a > result_b) and (result_a > result_a_b):
    print(result_a)
elif (result_b > result_a) and (result_b > result_a_b):
    print(result_b)
elif (result_a_b > result_a) and (result_a_b > result_b):
    print(result_a_b)

Submission status: Wrong Answer

Solution code:
i = [2,2]

if i[0] == i[1]:
    num = i[0]*2
else:
    max = max([i[0], i[1]])
    num = max + max-1

print(num)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
result_a = a + a - 1
result_b = b + b - 1
result_a_b = a + b
if result_a > result_b:
    if result_a > result_a_b:
        print(result_a)
elif result_b > result_a:
    if result_b > result_a_b:
        print(result_b)
else:
    print(result_a_b)

Submission status: Wrong Answer

Solution code:
a, b= (int(i) for i in input().split())  

def mod(a,b):
    c = a+a-1
    d = b+b-1
    e = a+b
    return max(c,d,e)
mod(a,b)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))

if i[0] == i[1]:
    num = i[0] + i[0] - 1
else:
    max = max([i[0], i[1]])
    num = max + max-1

print(num)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))

if i[0] == i[1]:
    num = i[0] + i[0] - 1
else:
    max = max([i[0], i[1]])
    num = max + max-1

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
result_a = a = a
result_b = b + b
result_a_b = a + b
if result_a > result_b:
    if result_a > result_a_b:
        print(result_a)
elif result_b > result_a:
    if result_b > result_a_b:
        print(result_b)
else:
    print(result_a_b)

Submission status: Wrong Answer

Solution code:
def mod(a,b):
    c = a+a-1
    d = b+b-1
    e = a+b
    return max(c,d,e)

Submission status: Wrong Answer

Solution code:
A, B= map(int,input().split())
if A > B:
 print(A + A - 1)
else:
 print(B + B - 1)

Submission status: Wrong Answer

Solution code:
map(int,input().split())

Submission status: Wrong Answer

Solution code:
def MaxCoinCount(A,B):
  max = 0
  for i in range(2):
    if A >= B:
      max = max + A
      A = A - 1
    else:
      max = max + B
      B = B - 1
  return max

print(MaxCoinCount(5, 6))

Submission status: Wrong Answer

Solution code:
a,b = [int(i) for i in input().split(" ")]
r = max(a,b)
print(2*r-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

print(max(a+b,(a-1)+a))

Submission status: Wrong Answer

Solution code:

A, B = map(int, input().split())
cnt = 0
for n in range(2):
    if A > B:
        cnt += A
        A -= 1
    elif A < B:
        cnt += B
        B -= 1
    else:
        cnt += A #同じとき
        A -= 1

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

print(max([A + B, A + A - 1, A + B - 1, B + A - 1]))

Submission status: Wrong Answer

Solution code:
def MaxCoinCount(A,B):
  max = 0
  for i in range(2):
    if A >= B:
      max = max + A
      A = A - 1
    else:
      max = max + B
      B = B - 1
  return max

Submission status: Wrong Answer

Solution code:
n = [int(s) for s in input().split()]

ma = max(n)
print(2 * ma - 1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
print('please input two number')
A, B = map(int, input().split())
C = 0
if (A < 3) or (B > 20) or (isinstance(A, int) != True) or (isinstance(B, int) != True):
    print('Error.')
    exit()
for i in range(2):
    if A > B:
        C += A
        A -= 1
        i += 1
    else:
        C += B
        B -= 1
        i += 1
print(C)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
c,d = (a-1,b-1)
lists = [a,b,c,d]
print(sum(lists[0:2]))

Submission status: Wrong Answer

Solution code:
import itertools
num = list(map(int, input().split()))
result = 0
tmp_1 = 0
tmp  =0
tmp_2 = 0
if num[0] == num[1]:
    tmp  = num[0] +  num[0] - 1
else:
    tmp = num[0] + num[1]
    tmp_1 = num[0] + num[0]
    tmp_2 = num[1] + num[1]
print(max(tmp,tmp_1,tmp_2))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split(" "))
max(A, B) + min(max(A - 1, B), max(A, B - 1))

Submission status: Wrong Answer

Solution code:
def button(a,b):
    if a==b:
        return int(a)+int(b)
    else:
        return 2*int(max(a,b))-1
a,b = map(int, input().split())
button(a,b)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if a != b:
    x= a*2 -1
else:
    x =a*2
print(x)

Submission status: Wrong Answer

Solution code:
def max_button(a,b):
    if a >= 3 and b <=20:        
        if a-1 == b:
            return (2*a-1)
        elif b-1 == a:
            return (2*b-1) 
        else:
            return a+b
    else:
        print("Wrong input")

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())

if A > B:
    print(A* 2)
else:
    print (B * 2)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
if A == B:
    print(A * B)
else:
    print(2 * max(A, B) - 1)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
if A>B:
    print(A+A-1) 
else:
    print(B+B-1)

Submission status: Wrong Answer

Solution code:
import itertools
num = list(map(int, input().split()))
num_2 = list(itertools.combinations_with_replacement(num, 2))
result = 0
tmp_1 = 0
tmp_2  =0
for i in range(len(num_2)):
    if num_2[i][0] == num_2[i][1]:
        tmp  = num_2[i][0] +  num_2[i][0] - 1
        tmp_1 =  num_2[i][0] +  num_2[i][0]
        tmp_2 = num_2[i][1] +  num_2[i][1]
    if result < tmp:
        result = max(tmp,tmp_1,tmp_2)
print(result)

Submission status: Wrong Answer

Solution code:
import itertools
num = list(map(int, input().split()))
num_2 = list(itertools.combinations_with_replacement(num, 2))
result = 0
tmp_1 = 0
for i in range(len(num_2)):
    if num_2[i][0] == num_2[i][1]:
        tmp  = num_2[i][0] +  num_2[i][0] - 1
        tmp_1 =  num_2[i][0] +  num_2[i][0]
    if result < tmp:
        result = max(tmp,tmp_1)
print(result)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if a == b:
    b = b-1
x = a + b
print(x)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
i = 0
X = 0
while i <= 1: 
    X += max(A,B)
    i += 1
print(X-1)

Submission status: Wrong Answer

Solution code:
def recur(ba,bb):
    print("Call: =(")
    if(ba <= 0 and bb <= 0):
        return 0
    if(ba <= 0):
        #only b twice
        return (bb*2)-1
    elif(bb<=0):
        return (ba*2)-1
    else:
        tb = max(bb+bb-1,recur(ba,bb-2))
        ta = max(ba+ba-1,recur(ba-2,bb))
        bt = max(ba+bb,recur(ba-1,bb-2))
        return max(max(tb,ta),bt)

a,b = [int(i) for i in input().split()]

print(recur(a,b))

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a - b == 0 or 1 or -1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1)

Submission status: Wrong Answer

Solution code:
A, B = list(map(int, input().split()))

def max_value(A, B):
    ##
    AA = A*(A-1)
    AB = A * B
    BB = B * (B-1)
    return max([AA, AB, BB])

def main():
    max_value(A, B)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import itertools
num = list(map(int, input().split()))
num_2 = list(itertools.combinations_with_replacement(num, 2))
result = 0
tmp = 0
for i in range(len(num_2)):
    if num_2[i][0] == num_2[i][1]:
        tmp = num_2[i][0] +  num_2[i][0] - 1
    if result < tmp:
        result = tmp 
print(result)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
X=int(0)
for i in range(2):
    if A>B:
        X+=int(A)
        A=A-1
    else:
        X+=int(B)
        B=B-1
    print(X)


print(X)

Submission status: Wrong Answer

Solution code:
total=0
A,B = map(int,input().split(" "))
if A>=B:
    tmp=B
    B=A
    A=tmp
total+=B
B=B-1
if A>=B:
    tmp=B
    B=A
    A=tmp
total+=B
print(B)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

ans = 0

for i in range(2):
  if B > A:
    ans += B
  else:
    ans += A
 
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())

if A==B:
  print(A+B)
elif A>=(B+2):
  print(A+(A-1))
else:
  print(B+(B-1))

Submission status: Wrong Answer

Solution code:
def MaxCoinCount(A,B):
  for i in range(2):
    if A >= B:
      max = A
      A = A - 1
    else:
      max = B
      B = B - 1
  return max

Submission status: Wrong Answer

Solution code:
a,b = map(int,(input().split()))
a = abs(a)
b = abs(b)
big = max(a,b)
ans = big + (big-1)
print(ans)

Submission status: Wrong Answer

Solution code:
total=0
A,B = map(int,input().split(" "))
if A>=B:
    tmp=B
    B=A
    A=tmp
total+=B
if A>=B:
    tmp=B
    B=A
    A=tmp
total+=B
print(total)

Submission status: Wrong Answer

Solution code:
inputs = input()
a = int(inputs.split(" ")[0])
b = int(inputs.split(" ")[1])
l = [a+b, a+a-1, b+a-1]
print(max(l))

Submission status: Wrong Answer

Solution code:
a, b =map(int, open(0).read().split())
if a < b:
  c = 2 * b - 1
  print(c)
if a == b:
  c = 2 * a
  print(c)
else:
  c = 2 * a -1
  print(c)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
coin = max(A, B) + max(A-1,B) if A>B else max(A, B-1)
print(coin)

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]
if a > b:
  print(a + (a - 1))
else:
  print(b + (b - 1))

Submission status: Wrong Answer

Solution code:
A = 20
 
B = 20
print (A + B)

Submission status: Wrong Answer

Solution code:
a, b =map(int, open(0).read().split())
if a <= b:
  c = 2 * b - 1
  print(c)
else:
  c = 2 * a -1
  print(c)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
 
ans = 0
a = max(a,b)
b = min(a,b)
ans += a
a -= 1
a = max(a,b)
b = min(a,b)
ans += a
 
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

def solve(a, b):
    if a > b + 1:
        return 2 * a - 1
    else:
        return a + b

if __name__ == '__main__':

    a, b = sys.stdin.readline().strip().split(" ")
    ans = solve(int(a), int(b))
    print ans

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

if a < b :
    print(2*a-1)
elif b > a:
    print(2*b-1)
elif a == b:
    print(a+b)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split(" ")))
x,y=sorted(a)
print(x,y)
if(y-1>x):
    print(y+y-1)
else:
    print(y+x)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
sub = abs(a-b)

if sub >= 1:
    print(max(a, b)*2 - 1)
else:
    print(a*2 - 1)

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split(' ')))
l.sort()
tmp = l[1]
if (l[1]-1>=l[0]):
    print(l[1]+l[0])
else :
    print(l[1]*2-1)

Submission status: Wrong Answer

Solution code:
a,b = map(int,(input().split()))
big = max(a,b)
ans = big + (big-1)
print(ans)

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split(' ')))
l.sort()
tmp = l[1]
if (l[1]-1>l[0]):
    print(l[1]+l[0])
else :
    print(l[1]*2-1)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
if i[0]>i[1] and i[0]-i[1]>=2:
	print(2*(i[0])-1)
elif i[1]>i[0] and i[1]-i[0]>=2:
	print(2*(i[1])-1)
else:
	i[1]+i[0]

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

l_button = max([a,b])

l_button += (l_button-1)

print(l_button)

Submission status: Wrong Answer

Solution code:
x = max([int(_) for _ in input().split()])
print(2 * x - 1)

Submission status: Wrong Answer

Solution code:
a,b=map(int,raw_input().split())

if abs(a-b)<=1:
	print a+b
else:
	print a+b+1

Submission status: Wrong Answer

Solution code:
A,B= map(int, input().split())
if A == B:
    B = B + 1
print(A + B)

Submission status: Wrong Answer

Solution code:
print(20 + 20)

Submission status: Wrong Answer

Solution code:
buttons = input().split(' ')
but1 = 0
but2 = 0
a = int(buttons[0])
b = int(buttons[1])

if a >= b:
    but1 = a - 1
else:
    but1 = b - 1

if a >= b:
    but2 = a
else:
    but2 = b

print (but1 + but2)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())

int(A)
int(B)
sum = 0

for i in range(2):
    if A > B:
        sum = sum + A
        A -= 1
    elif A < B:
        sum = sum + B
        B -= 1

print(sum)

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/abc124
# -*- coding: utf-8 -*-

a,b = map(int,input().split())
c = max(a,b)
c += max(a,b)-1
print(c)

Submission status: Wrong Answer

Solution code:
buttons = list(map(int, input().split()))

ans = 0
ans_list = []

ans_list.append(2 * buttons[0] - 1)
ans_list.append(2 * buttons[1] - 1)
ans_list.append(buttons[0] + buttons[1] - 1)
print(max(ans_list))

Submission status: Wrong Answer

Solution code:

def main():
	A,B = map(int,input().split())
	res = A if A >= B else B
	if res == A :
		A -= 1
	else :
		B -= 1
	res += A-1 if A-1>=B else B
	print(res)

if __name__ == "__main__" :
	main()

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
count = 0

for i in range(2):
    if a >= b:
        count += a
        a -= 1
    else:
        count += b
        b - 1
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# Input
list = [int(a) for a in input().split()]

#ソート
list.sort()
num = 0
if list[0] > list[1] + 1:
    num = list[0] * 2 - 1
else:
    mum = sum(list)

print(sum(list))

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

pattern1 = A+A-1
pattern2 = A+B-1
pattern3 = B+B-1

print(max(pattern1, pattern2, pattern3))

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
if A>B:
    if A>B:
        A=A-1
        print(A+A+1)
    else :
        print(A+B+1)
elif B>A:
    if B>A:
        B=B-1
        print(B+B+1)
    else :
        A=A-1
        print(B+A+1)

Submission status: Wrong Answer

Solution code:
A,B= map(int, input().split())
if A == B:
    B = B - 1
print(A + B)

Submission status: Wrong Answer

Solution code:
l = list(map(int, input().split(' ')))
l.sort()
tmp = l[1]
if (l[1]-1>=l[0]):
    print(l[1]+l[0])
else:
    print(l[1]*2)

Submission status: Wrong Answer

Solution code:
read = input
A,B = map(int , read().split())
if A > B:
    A,B = B,A
if A == B:
    print(A*2)
else :
    print(B*2 + 1)

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
print(max(A) * 2 - 1)

Submission status: Wrong Answer

Solution code:
l = input().split()
l.append(str(int(l[0]) - 1))
l.append(str(int(l[1]) - 1))
l.sort(reverse=True)
print(int(l[0]) + int(l[1]))

Submission status: Wrong Answer

Solution code:
A,B=map(int, raw_input().split())

if (A - B) > 1 :
    print A + A -1
elif A == B :
    print A + A
else:
    print B + B -1

Submission status: Wrong Answer

Solution code:

list = list(map(int,input().split(" ")))
max= max(list[0]+list[1],list[0]+(list[0]-1))
print(max)

Submission status: Wrong Answer

Solution code:
n = list(map(int,(input().strip().split(' '))))
a = n[0]
b = n[1]
t = 0
if a > b:
    t += a
    a -= 1
else:
    t += b
    b -= 1

if a > b:
    t += a
    a -= 1
else:
    t += a
    a -= 1

print(t)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

if __name__ == "__main__":
    A, B = map(int, input().split())
    total = 0
    for n in range(2):
        if A < B:
            total += A
            A = A - 1
        else:
            total += B
            B = B - 1
    
    print(total)

Submission status: Wrong Answer

Solution code:
ls = list(map(int, input().split()))
if abs(ls[0]-ls[1]) <= 1:
  print(ls[0]+ls[1]-1)
else:
  print(2*max(ls)-1)

Submission status: Wrong Answer

Solution code:
bottun = list(map(int, input().split()))

bottun.sort()
print(bottun[1])
bottun[1] -= 1
bottun.sort()
print(bottun[1])