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

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:
def main():
    A, B = map(int, input().split())

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

num_list = [A, B]
first_num = max(num_list)
first_choice_index = num_list.index(first_num)
num_list[first_choice_index] = num_list[first_choice_index] - 1
second_num = max(num_list)

print(first_num + second_num)

Submission status: Accepted

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

Submission status: Accepted

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

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:
x = list(map(int, input().split()))
print(max(x) * 2 - 1) if min(x) != max(x) else print(x[0] * 2)

Submission status: Accepted

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

print(max(x, y) + max(max(x, y)-1, min(x,y)))

Submission status: Accepted

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

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())
large = max(a,b)
small = min(a,b)

if large == small:
    print(large*2)
else:
    print(large*2-1)

Submission status: Accepted

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

Submission status: Accepted

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

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 = 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())
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
input=sys.stdin.readline

def main():
    A,B = map(int, input().split())
    a = [2*A-1, A+B, 2*B-1]
    print(max(a))

if __name__ == '__main__':
    main()

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

if abs(A-B) >= 2 :
	print(max([A,B])*2-1)
elif abs(A-B) == 1 :
	print(A+B)
else :
	print(A*2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A = [a, b, a-1, b-1]
A.sort()
print(A[-1] + A[-2])

Submission status: Accepted

Solution code:
def MAP(): return map(int,input().split())

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
def button(A,B):
  aa= A+(A-1)
  ab = A+B
  bb = B+(B-1)
  if aa>=bb and aa>=ab:
    return aa
  if bb>=aa and bb>=ab:
    return bb
  if ab>=aa and ab>=bb:
    return ab
print(button(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())
 
r1 = max(a,b)
 
if r1 == a:
  a -= 1
else:
  b -= 1
r2 = max(a,b)
 
print(r1+r2)

Submission status: Accepted

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

Submission status: Accepted

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

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:
AB = list(map(int,input().split()))
AB.sort()
#print(AB)
ma = max(AB)
print(ma + max(ma-1,AB[0]))

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
#ABC124 A
A,B = list(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())

if a > b:
    ans = a * 2 - 1
elif a < b:
    ans = b * 2 - 1
else:
    ans = a + b

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = list(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())

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 = [int(_) for _ in input().split()]

answer = max(max(a, b) * 2 - 1, a + b)

print(answer)

Submission status: Accepted

Solution code:
x=list(map(int,input().split()))
x.sort(reverse=True)
if x[0]-x[1]>=2:
  print(2*x[0]-1)
else:
  print(x[0]+x[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
ans += max(A, B)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
A=sorted([a,b,a-1,b-1],reverse=True)
print(A[0]+A[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())
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(max(a,b)*2-1 if a!=b else a+b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
#import math #python 3.5~
import fractions #fractions.gcd() python~3.4
sys.setrecursionlimit(1000000)

def main(): 

    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)


if __name__ == "__main__":
    main()

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())
ans = max(2*A-1,2*B-1,A+B)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = max(a,b) + max(max(a,b)-1, min(a,b))

print (ans)

Submission status: Accepted

Solution code:
ans = 0
N = list(map(int, input().split()))
for _ in range(2):
    N.sort(reverse=True)
    ans += N[0]
    N[0] -= 1
print(ans)

Submission status: Accepted

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

def main():
    A, B = map(int, input().split())
    if A == B:
        return 2 * A
    elif A > B:
        return 2 * A -1
    else:
        return 2 * B -1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if 3 <= a <= 20 and 3 <= b <= 20:
    print(max(a + a - 1, a + b, b + b -1))
else:
    print('invalid value')

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
answer = []
if a > b:
    answer.append(a)
    a -= 1
else:
    answer.append(b)
    b -= 1
answer.append(max(a, b))
print(sum(answer))

Submission status: Accepted

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


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

Submission status: Accepted

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

num1 = numbers[0]
num2 = numbers[1]

sum = 0
for i in range (2):
        
    if num1 >=num2:
        sum += num1
        num1 = num1 -1
    else:
        sum += num2
        num2 = num2-1

print (sum)

Submission status: Accepted

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

if A>B:
    getcoin=A
    A=A-1
elif A ==B:
    getcoin=A
    A=A-1
else:
    getcoin=B
    B=B-1

    
if A>B:
    getcoin+=A
elif A==B:
    getcoin+=A
else:
    getcoin+=B

print(getcoin)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (int(i) for i in 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 = list(map(int, input().split()))
m = 0
if A < B:
    m = m + B
    B = B -1
else:
    m = m + A
    A = A - 1

if A < B:
    m = m + B
    B = B -1
else:
    m = m + A
    A = A - 1

print(m)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
numlist = [a, b, a-1, b-1]
numlist.sort()
ans = numlist[2]+numlist[3]
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:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

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

A,B = II()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

inputa = input().split()

# inputb = input()


a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# inputList = list(inputb)
#
# inputList[b-1] = inputList[b-1].lower()
#
# ans = "".join(inputList)
ans = 0

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


print(ans)

# inputList.sort()
#
# list = [a+b, b+c ,c+a]
#
# ans = min(list)
# print(ans)



# flg = 1
# for i in range(0, len(inputList)-1):
#     if inputList[i] == inputList[i + 1]:
#         flg = 0
#         break
#
# if flg == 0:
#     print("Bad")
# else:
#     print("Good")

Submission status: Accepted

Solution code:
A,B = 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:
def test():
    a = list(map(int,input().split()))
    count = 0

    for i in range(2):
        count += max(a)
        b = a.index(max(a))
        a[b] = max(a) - 1

    print(count)


if __name__ == "__main__":
    test()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    print(solve())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

cnt += max(a, b)

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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 - 1 >= 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()) 
res = 0
if(a > b):
  res += a
  a -= 1
else:
  res += b
  b -= 1
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())

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if temp[0]-temp[1]!=0:
  print(max(temp)*2-1)
else:
  print(max(temp)*2)

Submission status: Accepted

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

sum = 0
for _ 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())

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

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

if a == b:
  print(a+b)

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

Submission status: Accepted

Solution code:
A,B=map(int, input().split())
if A-B>=1:
  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())
ans = max(A, B) + max(max(A, B) -1, min(A, B))
print(ans)

Submission status: Accepted

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

m=sorted(n,reverse=True)

tmp=0

tmp+=m[0]

m[0]-=1

print(tmp+max(m))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=input().split()
A,B=int(l[0]),int(l[1])
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())
if A == B: print(A*2)
else: print(max(A,B)*2-1)

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=(int(x) for x in input().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

result = 0
AB = list(map(int, input().split()))

# AB.sort()

# print(AB)

sorted_list = sorted(AB, reverse=True)

# print(sorted_list)

result += sorted_list[0]

if sorted_list[0] - 1 > sorted_list[1]:
    result += sorted_list[0] - 1
else:
    result += sorted_list[1]
    
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

A = int(N[0])
B = int(N[1])
T = 0

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

print(T)

Submission status: Accepted

Solution code:
def solve(string):
    a, b = map(int, string.split())
    return str(max(2 * a - 1, a + b, 2 * b - 1))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c, d = a-1, b-1

num = list(sorted([a, b, c, d]))

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().rstrip().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 = 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 + B)
else:
    print(2*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())
 
res = 0
 
if A > B:
  res = A + (A-1)
elif A == B:
  res = A + B
else:
  res = B + (B-1)
 
print(res)

Submission status: Accepted

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

result = 0
coin = 0

for i in range(2):
  coin = max(button)
  result += coin
  button[button.index(coin)] -= 1
  
  
print("{:d}".format(result))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

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

a, b = get_numbers()

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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 if not a==b else a+b)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
print(int(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:
n,m = map(int,input().split())
sum=0
if n>m:
  sum = sum + n
  n=n-1
else :
  sum += m
  m=m-1

if n>m:
  sum += n
  n=n-1
else :
  sum += m
  m=m-1
  
print(sum)

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:
A, B = list(map(int, input().split()))
if A != B:
	print(max(A,B)*2 - 1)
else:
	print(max(A,B)*2)

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

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

Submission status: Accepted

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

import numpy as np

res=0

for i in range(2):
	k=np.argmax(x)
	res+=x[k]
	x[k]-=1

print(res)

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:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces1197
gi = lambda : list(map(int,input().strip().split()))
a, b = gi()
if a == b:
	print(a + b)
else:
	print(max(a, b) * 2 - 1)

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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