Problem:


Score : 100 points

Problem Statement

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

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

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

At most how many coins can you get?

Constraints

All values in input are integers.

3 \leq A, B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the maximum number of coins you can get.

Sample Input 1

5 3

Sample Output 1

9

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

Sample Input 2

3 4

Sample Output 2

7

Sample Input 3

6 6

Sample Output 3

12



Sample input:
5 3


Sample output:
9

Submission status: Accepted

Solution code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

a,b = read_int()

def solve(a,b):
    ans = 0
    ans += max(a,b)
    if ans == a:
        a -= 1
    else:
        b -= 1
    ans += max(a,b)
    return ans

if __name__ == "__main__":
    print(solve(a,b))

Submission status: Accepted

Solution code:
a, b = list(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().rstrip().split())
print(max(A, B)*2 -1 if A != B else A*2)

Submission status: Accepted

Solution code:
import sys

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

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

print(str(sum))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
n = 0

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

print(n)

Submission status: Accepted

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

print(Ans)

Submission status: Accepted

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

t = [A + A - 1, A + B, B + B - 1]

print(max(t))

Submission status: Accepted

Solution code:
import numpy as np

a, b = np.sort([int(x) for x in input().split(" ")])

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

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:
buttons = list(map(int, input().split()))
buttons.sort(reverse=True)
ans = 0
ans += buttons[0]
buttons[0] = buttons[0] - 1
buttons.sort(reverse=True)
ans += buttons[0]
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(" "))
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())
sum = 0
if a <= b:
    sum = b
    b = b-1
else:
    sum = a
    a = a-1

if a <= b:
    sum = sum + b
else:
    sum = sum + a

print(sum)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=max(a,b)
print(x+max(x-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:
def main():
    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))
    return 0
main()

Submission status: Accepted

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

x = int(A) + int(B)
y = 2*int(A) - 1
z = 2*int(B) - 1

print(max(x,y,z))

Submission status: Accepted

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

Submission status: Accepted

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

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=list(map(int,input().split(" ")))
coin=[A+(A-1),B+(B-1),A+B]
print(max(coin))

Submission status: Accepted

Solution code:
import numpy as np

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

total = 0

for _ in range(2):
  idx = np.argmax(buttons)
  total += buttons[idx]
  buttons[idx] -= 1
 
print(total)

Submission status: Accepted

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

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


print(counter)

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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:
x,y = map(int,input().split())
ans = 0
if x < y:
    ans += y
    y -= 1
else:
    ans += x
    x -= 1

if x < y:
    ans += y
else:
    ans += x

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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:
line = raw_input()
A, B = list(map(int,line.split(' ')))

print max([A + A - 1, B + B - 1, A+ B])

Submission status: Accepted

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


def solv(a, b):
    ans = max(a+a-1, b+b-1, a+b)
    return ans


if __name__ == '__main__':

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

    ans = solv(a, b)

    print(ans)

Submission status: Accepted

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

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

print(coins)

Submission status: Accepted

Solution code:
a, b = (int(i) for i in 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())

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

reatInt = lambda: int(sys.stdin.readline())
reatIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]


a, b = reatIntN()
ma = max(a, b)
mi = min(a, b)

ret = (2 * ma - 1) if 2 <= (ma - mi) else (ma + mi)
print(ret)

Submission status: Accepted

Solution code:
(N,M) = (int(i) for i in input().split(" "))
if N==M:
  print(N+N)
else:
  print(max(N,M)*2-1)

Submission status: Accepted

Solution code:
import itertools
import sys

def main():
    a, b = input().split()
    a = int(a)
    b = int(b)
    print(max(a, b) + max([min(a, b), max(a, b)-1]))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import sys
input = sys.stdin.readline
a,b = input().split()
a = int(a)
b = int(b)
coin = 0
if a > b:
    coin += a
    a -= 1
else:
    coin += b
    b -= 1
if a > b:
    coin += a
    a -= 1
else:
    coin += b
    b -= 1
print(coin)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A = list(map(int, input().split()))
B = list(map(lambda x:x-1, A))

print(sum(sorted(A + B,reverse=True)[:2]))

Submission status: Accepted

Solution code:
import numpy as np

n = list(map(int, input().split())) # 整数
#print(n)
ans = 0
for i in range(2):
    if n[0] < n[1]:
        ans += n[1]
        n[1] -= 1
    else:
        ans += n[0]
        n[0] -= 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())
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 = 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= [int(x) for x in input().split()]

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

Submission status: Accepted

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

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

print(sum(ret[0:2]))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
s=input().split(' ')
a=int(s[0])
b=int(s[1])
x0=2*a-1
x1=2*b-1
x2=a+b

print(max((x0,x1,x2)))

Submission status: Accepted

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

Submission status: Accepted

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

if A > B:
	val = A
	A-=1
else:
	val = B
	B-=1

val+=max(A,B)

print(val)

Submission status: Accepted

Solution code:
import sys, copy
input = sys.stdin.readline
A, B = (int(x) for x in 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 i in range(2):
    if a > b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

Solution code:
a,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:
#N = int(input())
(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())

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = A + B
if A != B:
    ans = large + large - 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    c = [a,b, a-1, b-1]
    c.sort()
    print(c[3]+c[2])


solve()

Submission status: Accepted

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

for _ in range(0,2):
	if a >= b:
		got_coin += a
		a -= 1
	else:
		got_coin += b
		b -= 1
		
print(got_coin)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans+max(a,b))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
tmp1 = A + (A-1)
tmp2 = B + (B-1)
tmp3 = A + B
print(max(max(tmp1,tmp2), tmp3))

Submission status: Accepted

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

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

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 = [int(s) for s in input().split()]
if A < B:
    A, B = B, A
print(A + max(A-1, B))

Submission status: Accepted

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

Submission status: Accepted

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


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

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 = (int(i) for i in input().split())
if A==B:
    print(A*2)
elif A>B:
    print(A+(A-1))
else:
    print(B+(B-1))

Submission status: Accepted

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

a.sort()
we=a[1]

we2=max(we-1,a[0])
print(we+we2)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
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:
from sys import stdin

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

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

input = lambda: stdin.readline()
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
    else:
        c += b
        b -= 1
print(c)

Submission status: Accepted

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

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

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

print(m)

Submission status: Accepted

Solution code:
A,B = [int(c) for c in input().split()]
if A>B:
    print(A*2-1)
elif A==B:
    print(A*2)
else:
    print(B*2-1)

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

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

c = max([a, b])

if c == a:
    d = max([a - 1, b])
else:
    d = max([a, b - 1])

result = c + d
print(result)

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(2*A)

Submission status: Accepted

Solution code:
from sys import exit

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

if A > B:
    one = A
    A -= 1
else:
    one = B
    B -= 1

if A > B:
    two = A
else:
    two = B

print(one + two)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
a, b = (int(i) for i in 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())

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

Submission status: Accepted

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


if (b-1) > c:
    print(b+b-1)
    exit()
elif (c-1) >b:
    print(c+c-1)
    exit()

print(b+c)

Submission status: Accepted

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

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
else:
	count += B

print(count)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
A,B = map(int,input().split())
P = max(A,B)
if P == A:
    A-=1
else:
    B-=1
Q = max(A,B)
print(P+Q)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(a, b):
    r = 0
    if a == b:
        r = a + b
    else:
        t = max([a,b])
        r = t + t - 1
    print(r)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
max_=max(a,b)
min_=min(a,b)
count=0
for i in range(2):
    count+=max_
    max_-=1
    max_=max(max_,min_)
    min_=min(max_,min_)
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = max(a, b)
d = max(c - 1, min(a, b))

print(c + d)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split(' '))
result1 = A + B
result2 = A + (A -1 )
result3 = B + (B-1)
result = max(result1, result2, result3)
print(result)

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:
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

def main():
    X, Y=list(map(int,input().split()))
    coin=0
    for _ in range(2):
        if X>Y:
            coin+=X
            X-=1
        else:
            coin+=Y
            Y-=1
    print(coin)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

Solution code:
A, B = [int(s) for s in input().split(" ")]
print(max(2 * A - 1, A + B, 2 * B - 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 = [int(x) for x in input().split()]
if a == b:
    print(a + b)
else:
    o = 0
    if a > b:
        o += a
        a -= 1
        if a > b:
            o += a
        else:
            o += b
    else:
        o += b
        b -= 1
        if b > a:
            o += b
        else:
            o += a
    print(o)

Submission status: Accepted

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

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

Submission status: Accepted

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

sum = 0

for i in range(2):
    if x < y:
        sum += y
        y -= 1
    else:
        sum += x
        x -= 1

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#coding:utf-8

#input data
A, B = list(map(int, input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
c = 0
for _ 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())
cnt = 0
if a > b:
    cnt += a
    a-=1
else:
    cnt += b
    b -= 1
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())
max = 0
for n in range(2):
  if a > b:
    max += a
    a = a-1
  else :
    max += b
    b = b-1
    
print(max)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

deal_count = 2
get_coin = 0

for i in range(deal_count) :
    if (A == max([A,B])) :
        get_coin += A
        A -= 1
    else :
        get_coin += B
        B -= 1

print(get_coin)

Submission status: Accepted

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

result = 0
if A > B:
    result += A
    A -= 1
else:
    result += B
    B -= 1
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())
ans = 0
for i in range(2):
    ans += max(a, b)
    if a > b:
        a -= 1
    else:
        b -= 1
print(ans)

Submission status: Accepted

Solution code:
a,b = [int(item) for item in 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())

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)