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, raw_input().split())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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

ans = 0
ans_list = []

ans_list.append(2 * buttons[0] - 1)
ans_list.append(2 * buttons[1] - 1)
ans_list.append(buttons[0] + buttons[1])
print(max(ans_list))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
c=A+B
d=A+(A-1)
e=B+(B-1)
f=B+A
ans=max(c,d,e,f)
print(ans)

Submission status: Accepted

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

print(point)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = [int(x) for x in input().split()]
l.sort()
print(l[1]*2-1 if l[1]-1 >= l[0] else l[0]+l[1])

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
def get_input():
    A,B = [int(_) for _ in input().split(" ")]
    return A,B

def solve(A,B):
    return max([2*A-1,2*B-1,A+B])



if __name__ == "__main__":
    A,B = get_input()
    ans = solve(A,B)
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if (A > B) and ((A-1) >= B):
  ans_sum += A
  ans_sum += A-1
elif (B > A) and ((B-1) >= A):
  ans_sum += B
  ans_sum += B-1
elif A == B:
  ans_sum += A
  ans_sum += B
print(ans_sum)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
cnt=0
l=max(A,B)
m=min(A,B)
cnt=l
cnt+=max(l-1,m)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

a1 = a -1
b1 = b -1
sum = 0
if a1 > b1:
    sum = a + a1
elif a1 < b1:
    sum = b + b1
else:
    sum = a + b
print(sum)

Submission status: Accepted

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

n.sort()
if n[0] == n[1]:
    print(n[0] + n[1])
else:
    print(n[1]*2-1)

Submission status: Accepted

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

print(n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
buttons = list(map(int, input().split()))
result = 0
for i in range(2):
    max_val = max(buttons)
    max_idx = buttons.index(max_val)
    result += max_val
    buttons[max_idx] -= 1
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def calc(a, b):
    if (abs(a - b) == 0) | (abs(a - b) == 1):
        return a + b
    else:
        if a > b:
            return a + (a - 1)
        else:
            return b + (b - 1)

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

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

if a > b:
  print(out + a)
else:
  print(out + b)

Submission status: Accepted

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

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

elif A == B + 1 or A == B:
    print(A + B)

else:
    print(B + B - 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math


def solve(A: int, B: int):
    ans = 0
    if(A > B):
        ans += A
        A = A-1
    else:
        ans += B
        B = B-1

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

    print(ans)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
d1 = list(map(int, input().split()))
answer = 0
d1 = sorted(d1)
answer += d1[1]
d1[1] -= 1
if d1[1] < d1[0]:
    answer += d1[0]
else:
    answer += d1[1]
print(answer)

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()]
ans = 0
if (A == B):
    print(A + B)
elif (max(A, B) > (min(A, B) + 1)):
    print(max(A, B) * 2 - 1)
else:
    print(A + B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if A==B:
    num = A+B
elif A<B:
    num = B+(B-1)
else:
    num = A+(A-1)

print(num)

Submission status: Accepted

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

Submission status: Accepted

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


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


A, B = read_ints()

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
count = 0
for i in range(2):
    count = max(A,B)
    if A == B:
        A -= 1
    elif A == count and A!= B:
        A -= 1
    elif B == count and A != B:
        B -= 1
    ans += count

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
s=0
if a>=b:
    s=a
    a=a-1
else:
    s=b
    b=b-1
if a>=b:
    s=s+a
else:
    s=s+b
print(s)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

a2=a*2-1
b2=b*2-1
ab=a+b

answers=[ab,a2,b2]
print(max(answers))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = [int(i) for i in input().split()]
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())
sum = 0
if A < B:
    sum += B
    a = B - 1
    flag = True
else:
    sum += A
    a = A - 1
    flag = False

if flag:
    b = max(a, A)
    print(sum + b)
else:
    b = max(a, B)
    print(sum + b)

Submission status: Accepted

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

count = 0
i = 0
while i < 2:
    if A > B:
        count += A
        A -= 1
    else:
        count += B
        B -= 1
    i += 1

print count

Submission status: Accepted

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

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

ans = 0

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:
n = list(map(int,(input().strip().split(' '))))
a = n[0]
b = n[1]
t = 0
if a > b:
    t += a
    a -= 1
else:
    t += b
    b -= 1

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

print(t)

Submission status: Accepted

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

coin = 0
for i in range(0,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())

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

Submission status: Accepted

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

Submission status: Accepted

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

x = 0
if a > b: x = a*2 - 1
elif a == b: x = a*2
else: x = b*2 - 1

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import numpy as np

a,b=map(int, input().split())  #複数数値入力
x = 0
if a >= b:
    x += a
    a = a - 1
else:
    x += b
    b = b - 1

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

Submission status: Accepted

Solution code:
A=list(map(int,input().split()))
ans=0
ans+=max(A)
i=A.index(max(A))
A[i]-=1
ans+=max(A)
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 = list(map(int,input().split()))
c = 0
for i in range(0,2):
 if A < B:
  c += B
  B -= 1
 else:
  c += A
  A-= 1
print(c)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = []
for i in range(2):
    x = max(a, b)
    if x == a:
        a -= 1
    elif x == b:
        b -= 1
    ans += [x]
print(sum(ans))

Submission status: Accepted

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

s = 0
for i in [0,1]:
    if a > b:
        s = s + a
        a = a - 1
    else:
        s = s + b
        b = b - 1
print(s)

Submission status: Accepted

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

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main(inp):
    a,b=map(int,next(inp).split())
    if(a!=b): return 2*max(a,b)-1
    else: return a+b
    
print(main(sys.stdin))

Submission status: Accepted

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

Submission status: Accepted

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

coin = max(a, b)

if a < b:
  b -= 1
elif a > b:
  a -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=0

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

Submission status: Accepted

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

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = [N[0]*2 - 1,N[0]+N[1],N[1]*2 -1]

print(max(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:
import sys
input=sys.stdin.readline
'''
N=int(input())
H=map(int,input().split())
'''
N=list(map(int,input().split()))
s=0
for _ in range(2):
  if N[0]>N[1]:
    s+=N[0]
    N[0]-=1
  else:
    s+=N[1]
    N[1]-=1
print(s)

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

coin = 0

def get_coin(coin, A, B):
    if A >= B:
        coin += A
        A -= 1
    else:
        coin += B
        B -= 1
    return coin, A, B

for _ in range(2):
    coin, A, B = get_coin(coin, A, B)

print(coin)

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

result = 0
if A < B:
    result += B
    B -= 1
else:
    result += A
    A -= 1

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

Submission status: Accepted

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

def solve():
    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)


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = list(map(int, [i for i in input().split(" ")]))

if X[0] == X[1]:
  print(X[0]*2)
elif X[0] > X[1]:
  print(X[0]*2-1)
else:
  print(X[1]*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)

Submission status: Accepted

Solution code:
bottuns=list(map(int, input().split())) 
coins=0
for i in range(2):
    index = bottuns.index(max(bottuns))
    coins += bottuns[index]
    bottuns[index] = bottuns[index] - 1

print(coins)

Submission status: Accepted

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

if a>b:
    sum=2*a-1
if a==b:
    sum=2*a
if b>a:
    sum=2*b-1

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
s = input().rstrip().split(' ')
A = int(s[0])
B = int(s[1])
total = 0
for i in range(2):
    if A >= B:
        total = total + A 
        A = A - 1
    elif A < B:
        total = total + B
        B = B - 1
print(total)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
print(a + b if a == b else max(a * 2 - 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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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:
from sys import stdin
s_data = stdin.readline().rstrip().split()
data = [int(itr) for itr in s_data]
ans = 0
ans += max(data)
data[data.index(max(data))] -= 1
ans += max(data)
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().rstrip().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(i) for i in input().split()]
coins = 0
for i in range(2):
    coins += max([A,B])
    if A >= B :
        A-=1
    else:
        B-=1
print(coins)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

ab = [int(i) for i in input().split()]

result = 0

for _ in range(2):
  idx_big = np.argmax(ab)
  result += ab[idx_big]
  ab[idx_big] -= 1
  
print(result)

Submission status: Accepted

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

S = 0

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 20:56:51 2019

@author: shuto
"""

# -*- coding: utf-8 -*-
A, B = map(int, input().split())

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

else:
    tmp += B

    

print(tmp)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
big = max(A,B)
small = min(A,B)

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

Submission status: Accepted

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

c = a-1
d = b-1
e = [a,b,c,d]
e = sorted(e, reverse=True)
print(sum(e[:2]))

Submission status: Accepted

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

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


point = 0
for i in range(2):
    if A[0] >= A[1]:
        point += A[0]
        A[0] -= 1
    else:
        point += A[1]
        A[1] -= 1

print(point)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
list = list(map(int,input().split()))
list.sort(reverse=True)

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

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

    tmp = [A, B, A-1, B-1]
    tmp.sort()
    # print(tmp)
    print(sum(tmp[-2:]))



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n,m=input().split()
m=int(m)
n=int(n)
t = 0
if(n==m):
    t = 2*m
if(n>m):
    t = n + (n-1)
if(m>n):
    t = m + (m-1)
print(t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

from sys import stdin
    
def main():
    a,b = [int(x) for x in stdin.readline().rstrip().split()]
    ans = 0
    for x in range(2):
        if a > b:
            ans += a
            a -= 1
        else:
            ans += b
            b -= 1
    print(ans)
    
if __name__=='__main__':
    main()