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 sys import stdin


A, B = [int(x) for x in stdin.readline().rstrip().split()]

max = A + A -1
if max < A + B:
    max = A + B
if max < B + B - 1:
    max = B + B - 1

print(max)

Submission status: Accepted

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

lst = list()
lst.append(a)
lst.append(b)

ans_sum = 0
i = lst.index(max(lst))
ans_sum += lst[i]

lst[i] = lst[i] - 1
ans_sum += max(lst)

print(ans_sum)

Submission status: Accepted

Solution code:
input=input().split()
coin=0
A=int(input[0])
B=int(input[1])
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

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    A, B = MAP()
    if A - 1 > B:
        print(2 * A - 1)
    elif A < B - 1:
        print(2 * B - 1)
    else:
        print(A + B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

A, B = list(map(int,sys.stdin.readline().split()))

if A > B:
    print(A+max([A-1,B]))
else:
    print(B+max([A,B-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

print(ans+max(A, B))

Submission status: Accepted

Solution code:
list_ab = [int(x) for x in input().split()]
dict_ab = []
for x in list_ab:
  dict_ab.append(x)
dict_result = 0
for y in range(2):
  dic_max_i = max(dict_ab)
  dict_result = dict_result + dic_max_i
  dict_ab.remove(dic_max_i)
  dict_ab.append(dic_max_i-1)
print(dict_result)

Submission status: Accepted

Solution code:
A, B = list(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())
if A<B:
  print(2*B-1)
elif A==B:
  print(2*B)
else:
  print(2*A-1)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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:
a,b = map(int,input().split())
lists = [2*a-1,a+b,2*b-1]
print(max(lists))

Submission status: Accepted

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

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

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())
print(max([a+b, a*2-1, b*2-1]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if A > B:
    print(A+(A-1))
elif A == B:
    print(A*2)
else:
    print(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:
s=list(map(int,input().split()))
a=0
if s[0]<s[1]:
  a=a+s[1]
  s[1]=s[1]-1
else:
  a=a+s[0]
  s[0]=s[0]-1
  
if s[0]<s[1]:
  a=a+s[1]
  s[1]=s[1]-1
else:
  a=a+s[0]
  s[0]=s[0]-1
print(a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split()) # 横に2個

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

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(A+B)

Submission status: Accepted

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

coins = max(a,b)
if coins == a:
    a -= 1
elif coins == b:
    b -= 1
print(coins + max(a,b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a > b:
    big = a
    small = b
elif b > a:
    big = b
    small = a
elif a == b:
    big = a
    small = b

sum = big
big = big - 1
if big > small:
    sum += big
else:
    sum += small

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

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:
x,y=map(int,input().split())

if x>y:
  print(x+max(x-1,y))
else:
  print(y+max(x,y-1))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if a<b:
  a,b=b,a
s+=a; a-=1
if a<b:
  a,b=b,a
s+=a; a-=1

print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

c = max(a, b)

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

print(c + max(a,b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB=list(map(int, input().split()));print(sum(AB) if len(set(AB))==1 else max(AB)+max(AB)-1)

Submission status: Accepted

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

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())
x1 = a + (a-1)
x2 = a + b
x3 = b + b-1
print(max([x1, x2, x3]))

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
    else :
            x+=b
elif a<b:
    x+=b
    b-=1
    if a>=b:
            x+=a
    else :
            x+=b
print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

li = [a, a-1,b,b-1]
li.sort()

print(li[-1]+li[-2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-----------にゃんにゃん準備-----------#
def nyan(f=lambda x: x): return map(f,input().split())
#------------にゃんにゃん------------#
a,b = nyan(int)
print(max(a,b)*2-int(a!=b))
#---------にゃんにゃんおしまい---------#

Submission status: Accepted

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

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


abc()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

r1 = 0
if n1 >= n2:
    r1 += n1
    n1 -= 1
else:
    r1 += n2
    n2 -= 1

r1 += max(n1, n2)

print(r1)

Submission status: Accepted

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

print(ma)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
for i in range(2):
    ans += max(a, b)
    if max(a, b) == a:
        a -= 1
    else :
        b -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- Coding: utf-8 -*-
import numpy as np

A,B = map(int,raw_input().split())
coin = 0
for i in xrange(2):
  if A>B:
    coin += A
    A -= 1
  else:
    coin += B
    B -= 1

print coin

Submission status: Accepted

Solution code:

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

#A = int(A)
#B = int(B)
#print(str(A)+" "+str(B))

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

A = int(A)
B = int(B)
#print(str(A)+" "+str(B))

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 abs(A - B) >= 2:
  print(max(A, B) + max(A, B) - 1)
else:
  print(max(A, B) + min(A, B))

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:
# -*- coding: utf-8 -*-
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:
    print(A*2)
else:
    print(2*max(A,B)-1)

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:
a,b=map(int,input().split())
c=0
for i in range(2):
  if a>b:
    c+=a
    a-=1
  else:
    c+=b
    b-=1
print(c)

Submission status: Accepted

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

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

if a >= b:
    tmp2 = a
else:
    tmp2 = b

print(tmp1 + tmp2)

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())
p = max(a,b)
q = min(a,b)
print(p + max(p-1,q))

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
x = max(X,Y)
y = min(X, Y)
S = x + max(x-1, y)
print(S)

Submission status: Accepted

Solution code:
def Push(A,B):
	if A<=B:
		return B,A,B-1
	else:
		return A,A-1,B

def resolve():
	A,B=map(int,input().split())
	ans=0
	k,A,B=Push(A,B)
	ans+=k
	k,A,B=Push(A,B)
	ans+=k
	print(ans)

resolve()

Submission status: Accepted

Solution code:
# PROXY

num1, num2 = [int(i) for i in input().split()]
if num1 - num2 > 1:
    print(num1*2 -1)
elif num2 - num1 > 1:
    print(num2*2 -1)
else:
    print(num1 + num2)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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())
ans = 0

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

if A > B:
    ans += A
else:
    ans += B

print(ans)

Submission status: Accepted

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

import sys

input = sys.stdin.readline

def main():
    a, b = map(int, input().split())
    n = 0
    if a >= b + 2:
        n = a + a - 1
    elif a + 2 <= b:
        n = b + b - 1
    else:
        n = a + b
    print(n)

main()

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

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

Submission status: Accepted

Solution code:
def money(A, B):
    if A<B:
        return 2*B-1
    elif A>B:
        return 2*A-1
    else:
        return A+B

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

print(coin)

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:
inp = input().split(" ")
a = int(inp[0])
b = int(inp[1])
if a == b:
    print(a+b)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)

Submission status: Accepted

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

if __name__ == "__main__":
    method2()

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

if A<3 or B>20:
    print("Unexpaected A,B")
    exit()
else :
    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(a*2)
else:
    m = max(a ,b)
    print(m * 2 -1)

Submission status: Accepted

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

nums=[x,y,z]

print(max(nums))

Submission status: Accepted

Solution code:
def apply(a,b):
  if a>b:
    return (a, a-1, b)
  else:
    return (b, a, b-1)

if __name__ == '__main__':
  a,b = map(int,input().split())
  res = 0
  tmp, a, b = apply(a,b)
  res += tmp
  tmp, a, b = apply(a,b)
  res += tmp
  print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

num = max(A, B)

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

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

Submission status: Accepted

Solution code:
[a,b]=map(int, input().split())
sum = 0
for n in range(2):
  if a <= b:
    sum += b
    b -= 1
  else :
    sum += a
    a -= 1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
AB = input().split()
A = int(AB[0])
B = int(AB[1])
if A > B:
  print(2 * A - 1)
elif A < B:
  print(2 * B - 1)
else:
  print(2 * A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().split()]
    sum = 0
    for i in range(2):
        if A >= B:
            sum += A
            A -= 1
        else:
            sum += B
            B -= 1
    print(sum)


if __name__ == "__main__":
    main()

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:
#coding:utf-8
import sys
S = 0

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

if A == B:
    S += A*2
    print(S)
    sys.exit()

if A > B:
    S += A
    A = A - 1

else:
    S += B
    B = B - 1

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

Submission status: Accepted

Solution code:
b1, b2 = sorted([int(x) for x in input().split()])

if b1 < b2:
    print(2 * b2 - 1)
else:
    print(2 * b2)

Submission status: Accepted

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

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

Submission status: Accepted

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

f=max(a,b)
if a>b:
    s=max(a-1,b)
else:
    s=max(a,b-1)
print(f+s)

Submission status: Accepted

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

ans = 0
ans += max(A, B)

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

Submission status: Accepted

Solution code:
import sys
import os

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())
sum = 0
for x in range(2):
    if A >=B:
        sum += A
        A -= 1
    else:
        sum += B
        B -= 1
print(sum)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
x = max(a,b)
y = min(a,b)
ans = abs(x-y);
if ans >= 2:
  print(int(x+(x-1)))
else:
  print(int(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 = (int(i) for i in input().split()) 
C=0
if A >= B+1 :
	C=2*A-1
	print( '%d' % C  )
elif B >= A+1 :
	C=2*B-1
	print( '%d' % C )
else:
	C=2*A
	print( '%d'% C)

Submission status: Accepted

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

x1 = max(a, b)

if x1 == a:
  a = a-1
  x2 = max(a, b)
  print(x1+x2)
elif x1 == b:
  b = b-1
  x2 = max(a, b)
  print(x1+x2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input().split()
A=int(S[0])
B=int(S[1])

first=max(A,B)
dammy=min(A,B)
second=max(first-1,dammy)

out=first+second
print(out)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a,b=map(int,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())
ans = 0
for _ in range(2):
    tmp = max(a, b)
    if tmp == a:
        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(A + B)
elif A > B:
    print(A*2 - 1)
elif A < B:
    print(B*2 - 1)

Submission status: Accepted

Solution code:
a = [int(num) for num in input().split()]
a.sort(reverse=True)

if (a[0]-a[1]) >= 2 :
    print(a[0]*2-1)
else :
    print(a[0]+a[1])

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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())
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 = input().split()
A, B = int(A), int(B)
sum = 0
for i in range(2):
    sum += max(A, B)
    if A <= B:
        B -= 1
    else:
        A -= 1
print(sum)

Submission status: Accepted

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

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

combine = [a + a - 1, a + b, b + b - 1]

print(max(combine))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
button = input().split()
A = button[0]
B = button[1]
full = []
A = int(A)
B = int(B)
if A >=3 and B <= 20:
    if A + A -1 >= A + B and A + A -1 >= B + B -1:
        full.append(A + A -1)
    elif A + B >= A + A -1 and A + B >= B + B -1 :
        full.append(A + B)
    else:
        full.append(B + B - 1)
else:
    full.append(0)
print(max(full))

Submission status: Accepted

Solution code:
button = input().split()
A = int(button[0])
B = int(button[1])


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

Submission status: Accepted

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

Submission status: Accepted

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

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


print(num)

Submission status: Accepted

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

list = [A+B, 2*A-1, 2*B-1]
print(max(list))

Submission status: Accepted

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

coin = 0

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

print(coin)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
X = [A,B]
ans = 0

for i in range(2):
  ans += max(X)
  X[X.index(max(X))] = max(X) - 1

print(ans)

Submission status: Accepted

Solution code:
button = input().split()
a_button = int(button[0])
b_button = int(button[1])
sum = 0

for i in range(0, 2):
    if(a_button >= b_button):
        sum += a_button
        a_button -= 1

    elif(b_button > a_button):
        sum += b_button
        b_button -= 1

print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

if(abs(l[0]-l[1])>0):
  coin_sum = 2 * max(l[0],l[1]) - 1
else:
  coin_sum = 2 * max(l[0],l[1])

print(coin_sum)

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))
elif a == b:
    print(a+b)

Submission status: Accepted

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

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

total = 0

for c in range(2, 0, -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())
print(max(2 * A - 1,2 * B - 1,A + B))

Submission status: Accepted

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

    coin = 0;
    if a == b:
        print(a * 2)
    elif a < b:
        coin += b + max(a, b-1)
        print(coin)
    else:
        coin += a + max(a-1, b)
        print(coin)


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
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())

ans = 0
for _ in range(2):
    if A < B:
        ans += B
        B -= 1
    else:
        ans += A
        A -= 1
print(ans)

Submission status: Accepted

Solution code:
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]

A, B = LI()

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

Submission status: Accepted

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

if a==b:
    x=a*2;

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

print(x)

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

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
n_list = [a,b]
n_list.sort()
sum = 0
for i in range(2):
    sum = sum + n_list[1]
    n_list[1] = n_list[1]-1
    n_list.sort()
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# print(a,b)

coins = 0

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

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

print(coins)

Submission status: Accepted

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