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:
line = input()
A,B = [int(n) for n in line.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())

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

Submission status: Accepted

Solution code:
buttons=[]
for x in input().split():
    buttons.append(int(x))
if buttons[0]>buttons[1]:
    max=buttons[0]+(buttons[0]-1)
elif buttons[1]>buttons[0]:
    max=buttons[1]+(buttons[1]-1)
else:
    max=sum(buttons)

print(max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(x) for x in input().split()]
a.sort()
maior = 0
maior += a[-1]
a[-1] -= 1
a.sort()
maior += a[-1]
print(maior)

Submission status: Accepted

Solution code:
line = input()
numbers = [int(n) for n in line.split()]
predicted_value = max(numbers[0]+numbers[1], numbers[0]*2-1, numbers[1]*2-1)
print(predicted_value)

Submission status: Accepted

Solution code:
line = input()

a, b = [int(n) for n in line.split()]

apb = a+b

aa = a+(a-1)
bb = b+(b-1)

print(max(apb, max(bb, aa)))

Submission status: Accepted

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

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

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:
#!/usr/bin/env python3
a, b = map(int, input().split())
print(a + b) if a == b 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())
print(max(2*A-1,A+B,2*B-1))

Submission status: Accepted

Solution code:
import math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

a,b=MI()
L=[a,a-1,b,b-1]
L=sorted(L,reverse=True)
print(L[0]+L[1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split(' ')]
     
def f():
    res = 0
    if A > B and A - 1 > B:
        res = A + A - 1
    elif B > A and B - 1 > A:
        res = B + B - 1
    else:
        res = A + B
    return res
print(f())

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
res = 0
for _ 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(2*A-1, A+B, 2*B-1))

Submission status: Accepted

Solution code:
a,b = list(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:
ary1 = list(map(int,input().split()))
ary2 = ary1 + [x-1 for x in ary1]
ary2.sort()
print(ary2[2]+ary2[3])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = 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:
    c = a
    a -= 1
else :
    c = b
    b -= 1
if a>b :
    d = a
    a -= 1
else :
    d = b
    b -= 1
print(c + d)

Submission status: Accepted

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

total =0

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

print(total)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

A, B = mi()

if B > A:
    A, B = B, A

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
bottun=[int(i) for i in input().split()]
bottun.sort()
a=bottun[0]
b=bottun[1]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
tmp = max(a,b)
tmp2 = min(a,b)

print(tmp+max(tmp-1,tmp2))

Submission status: Accepted

Solution code:
# python 3.4.3
import sys
input = sys.stdin.readline
import numpy as np

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
A,B = map(int,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

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

Submission status: Accepted

Solution code:
s = sorted(map(int, input().split()))
print(s[1]*2 - 1 if s[1] - s[0] > 1 else sum(s))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

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

Submission status: Accepted

Solution code:
import numpy as np
import sys
a, b = map(int, input().split())
A = np.array([a + (a - 1), b + (b - 1), a + b])
print(np.max(A))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if A==B:
  count=A+B
  
elif A>B:
  count=count+A+A-1
  
elif A<B:
  count=count+B+B-1

print(count)

Submission status: Accepted

Solution code:
# ABC 124: A – Buttons
a, b = [int(s) for s in input().split()]
print(max(a * 2 - 1, a + b, b * 2 -1))

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
lis=[A,A-1,B,B-1]
C=sorted(lis)
print(C[-1]+C[-2])

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
p,q= input().split()
(a,b) =(int(p), int(q))
size_bottum = [a,b]
total = 0
if a is not b:
    total +=max(size_bottum)
    total +=max(size_bottum) -1
else:
    total += a*2
print(total)

Submission status: Accepted

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')

def main():
  a, b = map(int, readline().split())
  print(max(a+a-1,a+b,b+b-1))
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import fractions
def main():
  a,b = map(int,input().split())
  ans = 0
  for i in range(2):
    if a >= b:
      ans += a
      a -=1
    else:
      ans += b
      b -=1
  print(ans)
if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

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

Submission status: Accepted

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

if x == y:
  ans = x * 2
elif x > y:
  ans = 2*x - 1
else:
  ans = 2*y - 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

elif max(a, b) - min(a, b) >= 1:
    print(max(a, b) * 2 - 1)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
c = 2
d = []
while c > 0:
    if a > b :
        d.append(a)
        a -= 1
        c -= 1
    else:
        d.append(b)
        b -= 1
        c -= 1
print(d[0] + d[1])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

a, b = map(int, sys.stdin.readline().split())
if b > a:
    a, b = b, a

def main():
    if a == b: res = a * 2
    else: res = a * 2 - 1
    print(res)

if __name__ ==  '__main__':
    main()

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:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    count = max(a[0]*2-1,a[1]*2-1 ,a[0]+a[1])
    print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
a,b = iim()

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())
x = sorted([A, B])
first = x.pop(-1)
y = sorted([first-1, x.pop()])
second = max(y)
print(first+second)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = max(A, B)

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

cnt += max(A, B)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
import math

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

    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

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

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
a,b = map(int,input().split())

if b >= a:
    a,b = b,a

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

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

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:
def main():
  #n = int(input())
  #s = input()
  #s = input().split()
  a,b = list(map(int,input().split()))
  #c = [input().split() if i in range(n)]
  ans = 0
  
  for i in range(2):
    if a >= b:
      ans += a
      a -= 1
    else:
      ans += b
      b -= 1
  print(ans)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
A, B = map(int, input().split())
# print(A, B)
M = max(A, B)
N = min(A, B)
# print(M)
if abs(A - B) >= 1:
    ans = M + (M - 1)
else:
    ans = M + N
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

x = a + a-1
y = b + b-1
z = a + b 
print(max(x,y,z))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ma)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC124 A

def main():
    AB = list(map(int, input().split()))

    result = 0

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
X1 = max(A,B)
X2 = 0
if X1-1>min(A,B):
    X2 = X1-1
elif X1-1<=min(A,B):
    X2 = min(A,B)
print(X1+X2)

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
for _ in range(2):
    if X > Y:
        ans += X
        X -= 1
    else:
        ans += Y
        Y -= 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 + b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = max(a,b)
min_number = min(a,b)
ans += max(ans-1,min_number)
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:
def main():
    ab = list(map(int, input().split()))
    ans = 0
    for _ in range(2):
        button = max(ab)
        indx = ab.index(button)
        ans += button
        ab[indx] -= 1
    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
  else:
    c += b
    b -= 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

score=0

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

Submission status: Accepted

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

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:
from fractions import gcd

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0


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

print(ans)

Submission status: Accepted

Solution code:
# A - Buttons
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(sum)

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

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