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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

a, b = Is()
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:
def q1():
    A, B = (int(i) for i in input().split())

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


if __name__ == '__main__':
    print(q1())

Submission status: Accepted

Solution code:
a,b = tuple(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())
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())
X = 0
if A > B:
    X = A
    A -= 1
    if A > B:
        X += A
        print(X)
    else:
        X += B
        print(X)    
else:
    X = B
    B -= 1
    if A > B:
        X += A
        print(X)
    else:
        X += B
        print(X)

Submission status: Accepted

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


if __name__ == '__main__':

    ABC_124_A()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

INF = float("inf")

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

a,b = myinput()
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())
ans = 0
if A > B:
    ans += A + max(A-1, B)
else:
    ans += B + max(A, B-1)

print(ans)

Submission status: Accepted

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

count = 0

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

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

Submission status: Accepted

Solution code:
x = list(map(int, input().split()))
if x[0] == x[1]:
    print(x[0]+x[1])
elif x[0] > x[1]:
    print(x[0]+(x[0]-1))
elif x[0] < x[1]:
    print(x[1]+(x[1]-1))

Submission status: Accepted

Solution code:
A, B = [int(_) for _ in input().split()]

if A == B:
    print(A+B)
    exit()

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = 0
x = 0
while(x<2):
  if a<b:
    ans+=b
    b-=1
  else:
    ans+=a
    a-=1
  x+=1
print(ans)

Submission status: Accepted

Solution code:

if __name__ == "__main__":
    A, B = [int(a) for a in input().split()]
    cnt = 0
    for i in range(2):
        if A >= B:
            cnt += A
            A -= 1
        else:
            cnt += B
            B -= 1
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

print(max(2*A-1, A+B, 2*B-1))

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
print(n+(n-1) if n > m else m+(m-1) if n < m else n+m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
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(max(A+A-1,A+B,B+B-1))

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for _ in '__':
    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(a*2)
else:
    print(b*2-1)

Submission status: Accepted

Solution code:
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())
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()))
ans = 0
if A < B:
    ans += B
    B -= 1
else:
    ans += A
    A -= 1
if A < B:
    ans += B
    B -= 1
else:
    ans += A
    A -= 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B = map(int, input().split())
# A = list(map(int, input().split()))
print(max(A + B, 2 * A - 1, 2 * B -1))

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
if X < Y:
    ans = Y
    Y -= 1
else:
    ans = X
    X -= 1

if X < Y:
    ans += Y
else:
    ans += X

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
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:
# ABC124A

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

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:
ab = list(map(int,input().split()))
ab2 = sorted(ab)
coin = ab2[1]
ab2[1] = ab2[1]-1
ab3 = sorted(ab2)
coin += ab3[1]
print(coin)

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())
if  a == b:
    print(2*a)
else:
    print(2 * max(a,b) -1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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:
#!/usr/bin/env python3
a, b = sorted(map(int, input().split()))
print(max(b*2-1, a+b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())

_l = list([a+a-1, b+b-1, a+b])

ans = max(_l)

print(ans)

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())
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())
if A != B:
    x = max(A, B)
    print(2*x-1)
else:
    print(A + B)

Submission status: Accepted

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

Submission status: Accepted

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

a,b = max(a,b),min(a,b)

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

Submission status: Accepted

Solution code:
def buttons(a, b):

    return max(a, b) + max(max(a, b)-1,min(a, b))
def main():
    a, b = map(int, input().split())
    print(buttons(a, b))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans.append(a+b)
ans.append(a+(a-1))
ans.append(b+(b-1))

print(max(ans))

Submission status: Accepted

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

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:
a,b = map(int,input().split())
print(max([a+a-1,b+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(a*2)
elif a<b:
    print(b+(b-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 = [int(x) for x in input().split()]
print(max(a, b) * 2 - 1 if a != b else a * 2)

Submission status: Accepted

Solution code:
import sys
import math
from collections import Counter
import itertools
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

a,b=MI()

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

Submission status: Accepted

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

ans = 0
if a < b:
    ans += b
    b -= 1
else:
    ans += a
    a -= 1
print(max(a, b) + ans)

Submission status: Accepted

Solution code:

a,b = map(int,input().split())
cnt = 0

cnt += max(a,b)
if a >= b:
  a -= 1
else:
  b -= 1

cnt += max(a,b)
print(cnt)

Submission status: Accepted

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

x = max(a,b)
y = min(a,b)

if x - 2 >= y:
  print(x + x - 1)
else:
  print(x + y)

Submission status: Accepted

Solution code:
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())

lis=[2*a-1,a+b,2*b-1]
print(max(lis))

Submission status: Accepted

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

Submission status: Accepted

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

n = 2
total = 0
while n > 0:
  if a > b:
    total=total+a
    a-=1
  else:
    total=total+b
    b-=1
  n-=1
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for _ in range()]
if max(a, b) - min(a, b) > 0:
    print(max(a, b) * 2 - 1)
else:
    print(max(a, b) * 2)

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:
a,b=map(int,input().split())
ans=0
if max(a,b)==a:
  ans=ans+a
  a=a-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1
  elif max(a,b)==b:
    ans=ans+b
    b=b-1
elif max(a,b)==b:
  ans=ans+b
  b=b-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1    
  elif max(a,b)==b:
    ans=ans+b
    b=b-1      
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

aa = a+a-1
bb = b+b-1
ab = a+b

lists = [aa,bb,ab]
print(max(lists))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input().split()
a = int(x[0])
b = int(x[1])
count = 0
for i in range(0, 2):
  if a >= b:
    count += a
    a -= 1
  elif a <= b:
    count += b
    b -= 1
print(count)

Submission status: Accepted

Solution code:
# A - Buttons

a, b = map(int, input().split())

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

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
if x < y:
    x, y = y, x
m = x
x -= 1
print(m + max(x, y))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#copy

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

A, B = LI()

ans = max(A+B, max(A+A-1, B+B-1))
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print(A+B if abs(A-B)<=1 else 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(2*a)
else:
    print(2*b-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(coins)

Submission status: Accepted

Solution code:
def main():
    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)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = il()
    ret = max(A, B)
    if ret == A:
        ret += max(A - 1, B)
    else:
        ret += max(A, B - 1)
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(total)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
if a == b:
    print(2*a)
else:
    print(2*max(a, b) - 1)

Submission status: Accepted

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

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
print(max(2*A-1, 2*B-1, A+B))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    a,b=map(int, input().split())
    ans=0
    if a >= b:
        ans+= a
        a = a-1
        if a >= b:
            ans+= a

        elif b > a:
            ans+= b

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

        elif b>a:
            ans+= b
    print(ans)
resolve()

Submission status: Accepted

Solution code:
A, B = map(int, 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 >= 2:
  print(2 * A - 1)
elif B - A >= 2:
  print(2 * B - 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())
l=[a,a-1,b,b-1]
l.sort()
print(l[2]+l[3])

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:
import sys
readline = sys.stdin.readline

def main():
    A, B = map(int, readline().rstrip().split())
    print(max(A, B) + max(max(A, B) - 1, min(A, B)))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

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

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(a + max(a-1,b))
elif b > a:
	print(b + max(b-1,a))
else:
	print(a+b)

Submission status: Accepted

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

Submission status: Accepted

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

total = max(
    A + A - 1,
    B + B - 1,
    A + B,
)

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

if a==b:
    print(a+b)
else:
    c=max(a,b)
    print(c+(c-1))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
count = 0
coin = 0
while count < 2:
    if a >= b:
        coin += a
        a -= 1
        count += 1
    elif a <= b:
        coin += b
        b -= 1
        count += 1
print(coin)

Submission status: Accepted

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

if A - B > 1:
  x = 2 * A - 1
elif B - A > 1:
  x = 2 * B - 1
else:
  x = A + B

print(x)

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(A,B)+ max(max(A,B)-1,min(A,B)))

Submission status: Accepted

Solution code:
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(sum(Number))
else:
    print(Number[1]*2 -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())
x = int(2*a-1)
y = int(a+b)
z = int(2*b-1)
l = []
l.append(x)
l.append(y)
l.append(z)
print(max(l))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
if A == B:
    answer = A + B
else:
    C = max(A, B)
    answer = C + C - 1

print(answer)
# 36

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
m=max(a,b)
print(a+b if a==b else 2*m-1)

Submission status: Accepted

Solution code:
linha = input()
A,B = [int(n) for n in linha.split()]
lista = []
lista.append(A)
lista.append(B)
if A == B:
    print(A + B)
else:
    print(max(lista) + (max(lista) - 1))

Submission status: Accepted

Solution code:
line = input()
A,B = [int(n) for n in line.split()]

if(abs(A-B) >= 2):
    res = max(A,B)+(max(A,B)-1)
else:
    res = A+B
print(res)

Submission status: Accepted

Solution code:
line = input()
a, b = [int(n) for n in line.split()]
sum = 0
sum += max(a, b)
c = max(a, b)
d = min(a, b)
c-=1
sum+=max(c, d)
print(sum)

Submission status: Accepted

Solution code:
i = input().split()

a = int(i[0])
b = int(i[1])

once = a + b

twiceA = a + a - 1

twiceB = b + b -1

if once > twiceA and once > twiceB:
    print(once)
elif twiceA > twiceB:
    print(twiceA)
else:
    print(twiceB)

Submission status: Accepted

Solution code:
bottons=[]
for x in input().split():
    bottons.append(int(x))
if bottons[0]>bottons[1]:
    max=bottons[0]+(bottons[0]-1)
elif bottons[1]>bottons[0]:
    max=bottons[1]+(bottons[1]-1)
else:
    max=sum(bottons)

print(max)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input()
a, b = [int(n) for n in line.split()]

soma0= a + b

soma1 = a 
a = a-1
soma1 = soma1 + a 
a = a-1 

soma2 = b
b = b-1
soma2 = soma2 + b
b = b-1

if soma0>=soma1 and soma0>=soma2:
    print(soma0)

elif soma1>=soma0 and soma1>=soma2:
    print(soma1)

else:
    print(soma2)