Problem:


Score : 100 points

Problem Statement

There are two buttons, one of size A and one of size B.

When you press a button of size X, you get X coins and the size of that button decreases by 1.

You will press a button twice. Here, you can press the same button twice, or press both buttons once.

At most how many coins can you get?

Constraints

All values in input are integers.

3 \leq A, B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the maximum number of coins you can get.

Sample Input 1

5 3

Sample Output 1

9

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

Sample Input 2

3 4

Sample Output 2

7

Sample Input 3

6 6

Sample Output 3

12



Sample input:
5 3


Sample output:
9

Submission status: Wrong Answer

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

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

if __name__ == "__main__" :
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  a,b=map(int, input().split())  #複数数値入力
  print(max(a,b)+max(a,b)-1)

main()

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().strip().split(' '))
l = [a,b]
l.sort(reverse=True)
if a-1>b:
    print(a+a-1)
else:
    print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# In[5]:


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


# In[6]:


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


# In[ ]:

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#n=int(input())
#s=input()
a,b=map(int,input().split())
#A=[list(map(int,input().split()))for i in range(n)]
ans=0
c=max(a,b)
ans+=c
c=max(a,b)-1
ans+=c
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
a, b = map(int, input().split())

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

Submission status: Wrong Answer

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

print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

if __name__ == "__main__" :
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c = max(a, b)

print(c * 2 - 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

if __name__ == "__main__" :
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(max(a, b)*2)

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
A,B= map(int,input().split())
coins = 0
while True:
    if A > B :
        coins += A
    else:
        coins +=B
print(coins)

Submission status: Time Limit Exceeded

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

while tmp<3:
  if A > B:
    cnt+=A
    A-=1
    tmp+1
  elif A < B:
    cnt+=B
    B-=1
    tmp+1
  else:
    cnt+=A
    A-=1
    tmp+1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import sys
sys.setrecursionlimit(1000000000)

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


print(rec(1000000))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import random
A, B = map(int, input().split())
X = [[0] * (10**4) for _ in range(10**5)]
print(A)

Submission status: Time Limit Exceeded

Solution code:
import random
A, B = map(int, input().split())
X = [[0] * (10**4) for _ in range(10**5)]
print(A)

Submission status: Time Limit Exceeded

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

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

print(recur(a,b))

Submission status: Time Limit Exceeded

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

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

print(recur(a,b))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import math


def main():
    # n = int(input())
    a, b = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    # h = [int(input()) for _ in rane(n)]
    count = 0
    if a < b:
        count += b
        b = b - 1
    else:
        count += a
        a = a - 1
    if a < b:
        count += b
        b = b - 1
    else:
        count += a
        a = a - 1

    print(count)


if __name__ == '__main__':
    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())
ans = 0
for i in range(2):
    if a < b:
        ans += b
        b -= 1
    else:
        ans += a
        a -= 1
print(ans)

Submission status: Accepted

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

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

A = a + b
B = a + a - 1
C = b + b - 1

L = [A, B, C]

print(max(L))

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
rStr = input()

A = int(rStr.split(' ')[0])
B = int(rStr.split(' ')[1])

result = 0
index = 0

while index < 2 :
    if A <= B :
        result += B
        B = B - 1
    else :
        result += A
        A = A - 1
    index = index + 1

print(result)

Submission status: Accepted

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

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
    elif B > A:
        s += B
        B -= 1
    elif A == B:
        s += A
        A -= 1
print(s)

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,A+B,2*B-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
input = lambda: stdin.readline().rstrip()
a, b = map(int, input().split())
if a > b:
    ans = a + a - 1
elif a < b:
    ans = b + b - 1
else:
    ans = a + b
print(ans)

Submission status: Accepted

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


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

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 = 0
for _ in range(2):
  if a >= b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def count_coin_maximum():
    a_button, b_button = map(int, input().split())
    if a_button == b_button:
        return a_button + a_button
    elif a_button > b_button:
        return a_button + max(a_button - 1, b_button)
    else:
        return b_button + max(b_button - 1, a_button)


print(count_coin_maximum())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
#lis = list(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())
C=max(2*A-1,A+B,2*B-1)
print(C)

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

list=[a+b, 2*a-1, 2*b-1]

print(max(list))

Submission status: Accepted

Solution code:
#s=int(input())
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
a = list(map(int,input().split()))
#b = list(map(int,input().split()))
c=0
for i in range(2):
    c+=a[a.index(max(a))]
    a[a.index(max(a))]=a[a.index(max(a))]-1

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=input().rstrip().lstrip().split(" ")
print(max(int(l[0]), int(l[1])) + max(min(int(l[0]), int(l[1])), max(int(l[0]), int(l[1])) - 1))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
import random
import string
from copy import deepcopy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

A, B = getNM()
que = []
heapify(que)
heappush(que, -A)
heappush(que, -B)

ans = 0
for i in range(2):
    u = heappop(que)
    ans += -u
    heappush(que, u + 1)
print(ans)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    c1 = a + b
    c2 = a + a -1
    c3 = b + b -1
    print(max(c1, c2, c3))



main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x=[int(i) for i in input().split()]
x.append(x[0]-1)
x.append(x[1]-1)
x.sort()
print(sum(x[2:]))

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
if a<b:
    a,b = b,a

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
count=0
for v in range(2):
    if a[0]>=a[1]:
        count+=a[0]
        a[0]-=1
    else:
        count+=a[1]
        a[1]-=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=(int(x) for x in 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:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())

    vec = [A, B, A-1, B-1]
    vec.sort(reverse=True)

    print(sum(vec[:2]))

    return


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

Submission status: Accepted

Solution code:
#if elseによる実装
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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examA():
    A = LI()
    A.sort()
    ans = A[1] + max(A[1]-1,A[0])
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

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())
num = 0
for i in range(2):
    if a <= b:
        num += b
        b -= 1
    else:
        num += a
        a -= 1
print(num)

Submission status: Accepted

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

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:
# Written by Shagoto

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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