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: Accepted

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

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

Submission status: Accepted

Solution code:
num = input().split()
a = int(num[0])
b = int(num[1])
total = 0
for i in range(2):
    if a >= b:
        total += a
        a -= 1
    else:
        total += b
        b -= 1
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    x = sorted([a, a - 1, b, b - 1], reverse=True)
    print(sum(x[:2]))

main()

Submission status: Accepted

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

re = 0

for i in range(0,len(input)):
  re += max(input)
  input[input.index(max(input))] = max(input) - 1
  
print(re)

Submission status: Accepted

Solution code:
NUM_PUSH = 2


def main():
    A, B = map(int, input().split())
    sum = 0
    for i in range(NUM_PUSH):
        if A >= B:
            push = A
            A -= 1
        else:
            push = B
            B -= 1
        sum += push
    print(sum)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
ab = str(input())
a = int(ab.split()[0])
b = int(ab.split()[1])

coin = 0

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

print(coin)

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
sum=0;
if(a[0]>a[1]):
  sum+=a[0]
  a[0]-=1
else:
  sum+=a[1]
  a[1]-=1

if(a[0]>a[1]):
  sum+=a[0]
  a[0]-=1
else:
  sum+=a[1]
  a[1]-=1

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(num_coin)

Submission status: Accepted

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

a=li[0]
b=li[1]

ans=0

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

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a > b:
    print(a + (a-1))
elif a < b:
    print(b + (b-1))
else:
    print(a + b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(SUM)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
i = 2
while i > 0:
    if i==2 and A == B:
        ans = 2 * A
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

AB = []
AB += [A, B]

def push(AB):
  if AB[0] >= AB[1]:
    i = 0
  else:
    i = 1
  ret = AB[i]
  AB[i] -= 1
  return ret

s = 0
for _ in range(2):
	s += push(AB)

print(s)

Submission status: Accepted

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

def f(a,b):
  if a == b:
    ans = a*2
  elif a > b:
    ans = a + (a-1)
  elif a < b:
    ans = b + (b-1)
  return ans

print(f(a,b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Input
list = [int(a) for a in input().split()]
 
#ソート
list.sort()
 
num = 0
if list[1] > list[0] + 1:
    num = list[1] * 2 - 1
else:
    num = sum(list)
 
print(num)

Submission status: Accepted

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

if A==B:
    print(A+B)
else:
    print(2*max(A,B)-1)

Submission status: Accepted

Solution code:
#coding: utf-8
a, b = map(int, input().split())
result = 0
     
if(a>b):
    result += a
    a = a-1
else:
    result += b
    b = b-1
     
result += max(a,b)
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(2):
    if A < B:
         coin = coin + B
         B -= 1
    else:
         coin = coin + A
         A -= 1

print(coin)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if A > B:
    answer += A
    A -= 1
else:
    answer += B
    B -= 1

answer += max(A,B)
print(answer)

Submission status: Accepted

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

cnt = 2
add = 0

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

Submission status: Accepted

Solution code:
l = [int(i) for i in input().split()]
a = 0
for i in range(2):
  if l[0]>l[1]:
    a += l[0]
    l[0] -= 1
  else:
    a += l[1]
    l[1] -= 1
print(a)

Submission status: Accepted

Solution code:
import sys

x, y = map(int, sys.stdin.readline().split())

if x == y:
    print(x * 2)
else:
    print(max(x, y)*2-1)

Submission status: Accepted

Solution code:
a,b = (int(num) for num in input().split())
if a == b:
    print(a+b)
else:
    print(max(a,b)*2-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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
        B = B - 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python

def main():
    N = [int(x) for x in input().split()]
    max_1 = max(N)
    N[N.index(max(N))] = max(N) - 1
    max_2 = max(N)
    print(max_1+max_2)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

A = input[0]
B = input[1]

sum = 0

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

Submission status: Accepted

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

a.sort(reverse=True)

ans = a[0]

a[0] -= 1

a.sort(reverse=True)

ans += a[0]

print(ans)

Submission status: Accepted

Solution code:
import sys

line = list(map(int,input().split()))

if line[0] - line[1] >= 2:
	ans = 2*line[0] - 1	
elif line[1] - line[0] >= 2:
	ans = 2*line[1] - 1
else:
	ans = line[0] + line[1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

A,B = (int(x) for x in input().split())

if A > B:
	ans = A
	A-=1
	
else:
	ans = B
	B-=1
	
ans += max(A,B)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
if a > b + 1:
  print(2*a - 1)
elif b > a + 1:
  print(2*b - 1)
else:
  print(a + b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
wklist = list(map(int,input().split()))
ans = 0
for i in range(2):
  ans += max(wklist)
  wklist[wklist.index(max(wklist))] -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = [ i for i in map(int, input().split())]
maximum = 0

patten1 = inp[0] + inp[0]-1
patten2 = inp[0] + inp[1]
patten3 = inp[1] + inp[1]-1

if patten1 > patten2 :
  maximum = patten1
else:
  maximum = patten2

if maximum > patten3:
  print(maximum)
else:
  print(patten3)

Submission status: Accepted

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

Submission status: Accepted

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

score = 0
if A >= B:
  score += A
  A -= 1
else:
  score += B
  B -= 1
if A >= B:
  score += A
else:
  score += B

print(score)

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]
t = max(A, B)
print(t + max(t - 1, min(A, B)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input().split()
if int(str[0]) > int(str[1]):
    a = int(str[0])
    if int(str[0])-1 > int(str[1]):
        b = int(str[0])-1
    else:
        b = int(str[1])
else:
    a = int(str[1])
    if int(str[1])-1 > int(str[0]):
        b = int(str[1])-1
    else:
        b = int(str[0])

c = a + b
print(c)

Submission status: Accepted

Solution code:
a_origin, b_origin = [int(s) for s in input().split(" ")]

def press_x(x, coin):
    coin += x
    x -= 1
    return x, coin

a, b = a_origin, b_origin
coin_aa = 0
a, coin_aa = press_x(a, coin_aa)
a, coin_aa = press_x(a, coin_aa)

a, b = a_origin, b_origin
coin_ab = 0
a, coin_ab = press_x(a, coin_ab)
b, coin_ab = press_x(b, coin_ab)

a, b = a_origin, b_origin
coin_bb = 0
b, coin_bb = press_x(b, coin_bb)
b, coin_bb = press_x(b, coin_bb)

a, b = a_origin, b_origin
coin_ba = 0
b, coin_ba = press_x(b, coin_ba)
a, coin_ba = press_x(a, coin_ba)

print(max([coin_aa, coin_ab, coin_ba, coin_bb]))

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
    A, B = list(map(lambda x:int(x), sys.stdin.readline().split(' ')))
    ans = 0
    for i in range(2):
        if A >= B:
            ans += A
            A -= 1
        else:
            ans += B
            B -= 1
    print(ans)

Submission status: Accepted

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)

if nums[0] == nums[1]:
    print(num*2)
else:
    print(num*2-1)

Submission status: Accepted

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

print(sum(list(sorted([a, a - 1, b, b - 1], reverse=True))[:2]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input().rstrip().split(' ')
o = 0
A = int(S[0])
B = int(S[1])
l = 0
while l < 2:
  if A>=B:
    o +=A
    A-= 1
    l +=1
  else:
    o += B
    B -= 1
    l +=1
print(o)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
m = [a, b]
m.sort()

if m[1] > m[0] + 1:
    print((2 * m[1]) - 1)

else:
    print(m[0] + m[1])

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())
c = max(a+(a-1),a+b,b+(b-1))
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
a,b=(int(i) for i in input().split())
ans=max(a+a-1,b+b-1,a+b)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print("{}".format(result))

Submission status: Accepted

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
  else:
    return x+y
 
 
print(Buttons(a,b))

Submission status: Accepted

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

Submission status: Accepted

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

if A == B:
    print(2*max(A, B))
else:
    print(max(A, B)+max(A, B)-1)

Submission status: Accepted

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

result = 0

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

print(result)

Submission status: Accepted

Solution code:
a,b=input().split()
a=int(a)
b=int(b)
sum=0
for i in range(1,3):
    sum += max(a,b)
    if (sum == a ):
        a -=1
    elif (sum==b):
        b -=1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
a, b = map(int, input().split())
 
aa = 2*a - 1
ab = a + b
bb = 2*b - 1
 
print(max(aa, ab, bb))

Submission status: Accepted

Solution code:
num=list(map(int,input().split()))
ans=0
num.sort(reverse=True)
ans += num[0]
num[0]-=1
num.sort(reverse=True)
ans += num[0]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())
 
    A, B = max(A, B), min(A, B)
    if A == B:
        return 2 * A
    else:
        return 2 * A - 1
 
 
if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

count = 0

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

Submission status: Accepted

Solution code:
import numpy as np
 
a,b=(int(x) for x in input().split())
sum=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
sum1 = A + (A-1)
sum2 = A + B
sum3 = B + (B - 1)
ans = max(sum1,sum2,sum3)
print(ans)

Submission status: Accepted

Solution code:
#A

a,b = (int(x) for x in 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: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys

input = sys.stdin.readline
a, b = map(int, input().split())

ans = 0
if a > b:
    ans = a + a - 1
elif b > a:
    ans = b + b - 1
else:
    ans = a + b

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
a = max(A,B)
b = min(A,B)
t = a - b
if t <= 1:
  print(a + b)
else:
  print(a + a - 1)

Submission status: Accepted

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

Submission status: Accepted

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

c = []

if a == b:
    print(a + b)
    
elif a > b:
    c.append(a)
    a = a - 1
    if a > b:
        c.append(a)
    else:
        c.append(b)
    print(sum(c))
    
elif a < b:
    c.append(b)
    b = b - 1
    if a > b:
        c.append(a)
    else:
        c.append(b)
    print(sum(c))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
print(max(2*l[0]-1, 2*l[1]-1, l[0]+l[1]))

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
x = l[0]
y = l[1]
print(max(2*x-1, 2*y-1, x+y))

Submission status: Accepted

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

Submission status: Accepted

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

candidates = [2*val_int[0]-1, val_int[0]+val_int[1], 2*val_int[1]-1]

print(max(candidates))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    p, q = input().split()
    p = int(p)
    q = int(q)
    if p > q:
        answer = p
        p = p - 1
    else:
        answer = q
        q = q - 1
    if p > q:
        answer += p
    else:
        answer += q
    print(answer)

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
print(max([max(a)*2-1,sum(a)]))

Submission status: Accepted

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

if a == b:
    coin = a + b
else:
    if a > b:
        coin = a
        a -= 1
    elif b > a:
        coin = b
        b -= 1

    if a > b:
        coin += a
        a -= 1
    elif b > a:
        coin += b
        b -= 1
    else:
        coin += a

print(coin)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X=list(map(int,input().split()))
print(max([sum(X),max(X)*2-1]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

#2以上差がある場合
if max(A, B) - 2 >= min(A, B):
    ans = max(A, B) * 2 - 1

#差が1以下の場合
else:
    ans = A + B

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans=0

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

Submission status: Accepted

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

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

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

button2 = inputs[1]

print(button1 + button2)

Submission status: Accepted

Solution code:
#ABC124 A
ans = 0
A, B = list(map(int, input().split()))

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:


A, B = map(int, input().split())

coin = 0

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

print(coin)

Submission status: Accepted

Solution code:
import sys,math
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A - Buttons

A, B = map(int, input().split())
total = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#abc124a

a,b=map(int,raw_input().split())
if a>b:
 print a+a-1
elif b>a:
 print b+b-1
else:
 print a+b

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check_max_coin(a,b):
  max_coin = 0
  for i in range(1,3):
    if a < b :
      max_coin += b 
      b-=1 
    else:
      max_coin += a  
      a-=1    
  print(max_coin)
  
a, b = map(int, input().split())
check_max_coin(a,b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
a1 = a
a2 = a-1
b1 = b
b2 = b-1

if a == b:
    ans = a1 + b1
elif a > b:
    ans = a1 + a2
elif b > a:
    ans = b1 + b2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(c)

Submission status: Accepted

Solution code:
line = input().strip()
line = line.split(' ')
A = int(line[0])
B = int(line[1])
ans = 0
ans = max(ans, A + A - 1)
ans = max(ans, A + B)
ans = max(ans, B + B - 1)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)