Problem:


Score : 100 points

Problem Statement

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

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

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

At most how many coins can you get?

Constraints

All values in input are integers.

3 \leq A, B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the maximum number of coins you can get.

Sample Input 1

5 3

Sample Output 1

9

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

Sample Input 2

3 4

Sample Output 2

7

Sample Input 3

6 6

Sample Output 3

12



Sample input:
5 3


Sample output:
9

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(max(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
A, B = list(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())
print(max([A + A - 1, B + A, B + B -1]))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if a>=b:
    k=k+a
else:
    k=k+b

print(k)

Submission status: Accepted

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

def MaxCoinCount(A,B):
  ans = 0
  if A > B:
    ans = A + (A - 1)
  elif A < B:
    ans = B + (B - 1)
  else:
    ans = A + B
  return ans


print(MaxCoinCount(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(max(a+b, a*2-1, b*2-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:
input_ = list(map(int,input().split()))
x = input_[0]
y = input_[1]
point = max(x,y)
if point == x:
  x -= 1
else:
    y -= 1
point += max(x,y)
print(point)

Submission status: Accepted

Solution code:
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#n=int(input())
#li=input().split()
#S=input()

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

if lis[0]>lis[1]:
    ans+=lis[0]
else:
    ans+=lis[1]

print(ans)

Submission status: Accepted

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

ans = 0


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

    elif a < b:
        ans += b
        b -= 1

print(ans)

Submission status: Accepted

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

list_button_coin_1 = [A, B]
list_button_coin_2 = [A-1, B-1]
list_total_coin = []

for i in list_button_coin_1:
	for j in list_button_coin_2:
		list_total_coin.append(i+j)
		
list_total_coin.append(A+B)

print(max(list_total_coin))

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=[int(i) for i in input().split()]
x.sort()
ans=x[-1]
x[-1]-=1
print(ans+max(x))

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
if a > b:
	result = result + a
	a = a -1
else:
	result = result + b
	b = b -1

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = input().split()
b = int(a[0])
c = int(a[1])
if b > c:
	first = b
	b = b-1
else:
	first = c
	c = c-1
if b > c:
	second = b
else:
	second = c
answer = first + second
print(str(answer))

Submission status: Accepted

Solution code:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
a,b=IL()
if a==b:
  print(a+b)
else:
  print(2*max(a,b)-1)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num = 0
for i in range(0,2):
    if a < b:
        num = num + b
        b = b - 1
    elif a > b:
        num = num + a
        a = a - 1
    else:
        num = num + a
        a = a - 1

print(num)

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:
import numpy as np
x = input()
#入力の読み込み
a,b = map(int,x.split())

data = np.array([a, b, a-1, b-1])
X = np.sort(data)[::-1]
wa = X[0]+X[1]
print(wa)

Submission status: Accepted

Solution code:
s = input().split()
t = int(s[0])
k = int(s[1])
li = []
li.append(k)
li.append(t)
li.sort()
n = li.pop(1)
li.append(n - 1)
li.sort()
n += int(li[1])
print(n)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d = list(map(int,input().split()))
A = d[0]
B = d[1]
s = 0

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

elif A == B :
    s = A + A

else:
    s = B + B - 1

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
	buttons = list(map(int, input().split()))
	aa = buttons[0] + (buttons[0] - 1)
	ab = buttons[0] + buttons[1]
	bb = buttons[1] + (buttons[1] - 1)
	print(max(aa, ab, bb))

main()

Submission status: Accepted

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

Submission status: Accepted

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

coin = 0

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for i in range(2):

  if A > 3 and A >= B:
    ans += A
    A -= 1
    continue

  if B > 3 and B > A:
    ans += B
    B -= 1
    continue
  
  if A == 3 and B == 3:
    ans += A

print(ans)

Submission status: Accepted

Solution code:
coin = list(map(int, input().split()))
a=coin[0]
b=coin[1]

sum1=a+a-1
sum2=a+b
sum3=b+b-1

if sum1<sum2:
    if sum3<sum2:
        ans=sum2
    else:
        ans=sum3
else:
    if sum1>=sum3:
        ans=sum1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B):
    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

    return ans


def main():
    A, B = read_int_n()
    print(slv(A, B))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

b = a.index(max(a))

a[b] = a[b] - 1

output = output + max(a)

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A, B = map(int, input().split())
C = 0
if (A < 3) or (B > 20) or (isinstance(A, int) != True) or (isinstance(B, int) != True):
    exit()
for i in range(2):
    if A > B:
        C += A
        A -= 1
        i += 1
    else:
        C += B
        B -= 1
        i += 1
print(C)

Submission status: Accepted

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

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

Submission status: Accepted

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

A = int(A)
B = int(B)

if A > B :
    X = A
    A = A - 1

else :
    X = B
    B = B - 1

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

print(X)

Submission status: Accepted

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

ret = x
x -= 1
ret += max(x, y)
print(ret)

Submission status: Accepted

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

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

x = 0

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

print(x)

Submission status: Accepted

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

for _ in [0,1]:
    if a > b:
        s += a
        a -= 1
    else:
        s += b
        b -= 1

print(s)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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_a = a + a - 1
result_b = b + b - 1
result_a_b = a + b
if (result_a_b >= result_a) and (result_a_b >= result_b):
    print(result_a_b)
elif (result_a >= result_b) and (result_a >= result_a_b):
    print(result_a)
elif (result_b >= result_a) and (result_b >= result_a_b):
    print(result_b)

Submission status: Accepted

Solution code:
inp = input().split()
for i in range(2):
    inp[i] = int(inp[i])
number = 0
for i in range(2):
    if inp[0] < inp[1]:
        number += inp[1]
        inp[1] -= 1
    else:
        number += inp[0]
        inp[0] -= 1
print(number)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(answer+max((a,b)))

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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:
# -*- coding: utf-8 -*-

import sys
import copy

input = sys.stdin.readline

# ---------------------------------------------------------

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

A, B = max(A, B), min(A, B)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import copy

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

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

Submission status: Accepted

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

if a == b:
    coin = a*2
else:
    if a > b:
        coin = a*2-1
    else:
        coin = b*2-1

print (coin)

Submission status: Accepted

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

Submission status: Accepted

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

if i[0] == i[1]:
    num = i[0]*2
else:
    max = max([i[0], i[1]])
    num = max + max-1

print(num)

Submission status: Accepted

Solution code:
a = input()

inp = a.split()

inp = [int(i) for i in inp]


point  = 0

for i in range(2):
	maxinp = 0
	maxind = 0
	for index, s in enumerate(inp):
		if maxinp < s:
			maxinp = s
			maxind = index
	
	point += maxinp
	inp[maxind] = maxinp - 1

print(point)

Submission status: Accepted

Solution code:
from sys import stdin

A, B = stdin.readline().rstrip().split()
A, B = int(A), int(B)

first = 2 * A - 1
second = A + B
third = 2 * B - 1

max = max(first, second, third)
print(max)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import re

a = input()
a = re.split(" ",a)
c = []
b = max(int(a[0]), int(a[1]))
if(b == int(a[0])):
    c.append(int(a[0])-1)
    c.append(int(a[1]))
if(b == int(a[1])):
    c.append(int(a[1])-1)
    c.append(int(a[0]))

d = max(int(c[0]),int(c[1]))
ans = b + d
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

score = 0

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

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

print(score)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
A - Buttons
https://atcoder.jp/contests/abc124/tasks/abc124_a
"""
if __name__ == '__main__':
    input_list = list(map(int, input().split()))
    a = input_list[0]
    b = input_list[1]
    button_suspects = sorted([a, a-1, b, b-1], reverse=True)
    answer = button_suspects[0] + button_suspects[1]
    print(answer)

Submission status: Accepted

Solution code:
buttonList = list(map(int,input().split()))
a = buttonList[0]
b = buttonList[1]
sum = 0

if(a >= b):
  sum += a
  a -= 1
elif(a < b):
  sum += b
  b -=1

if(a >= b):
  sum += a
  a -= 1
elif(a < b):
  sum += b
  b -=1

print(sum)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
l = [A, B, A-1, B-1]
m = sorted(l, reverse=True)
print(m[0]+m[1])

Submission status: Accepted

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

Submission status: Accepted

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

print(max(a + b, a + a_min, b + b_min))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    a, b = [int(i) for i in input().split()]
    if a == b:
        print(a + b)
    else:
        max_ = max([a, b])
        print(max_ * 2 - 1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_coin(a,b,coin=0):
  if a >= b:
    coin += a
    if a > 3:
      a-=1
  else:
    coin += b
    if b > 0:
      b-=1
  return a,b,coin

a = list(map(int,input().split()))
b,c,d = get_coin(a[0],a[1])
e,f,g = get_coin(b,c,d)
print(g)

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	a,b = map(int, io().split())
	if a==b:
		ret=2*a
	else:
		c=max(a,b)
		ret=2*c-1

	return ret

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

A = [0,0]
A[0], A[1] = [int(s) for s in stdin.readline().rstrip().split()]

sum = [A[0] - 1 + A[0], A[1] + A[1] -1 , A[0] + A[1]] 

print(max(sum))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

print(result)

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
total = [A,A-1,B,B-1]
result = max(total)
total.remove(result)
result += max(total)
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
def main(a, b):
    return max([a+a-1,
                a+b,
                b+b-1,
                b+a])


if __name__ == "__main__":
    a, b = list(map(int, input().split()))
    print(main(a, b))

Submission status: Accepted

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

cnt = 0
for n in range(2):
    if A > B:
        cnt += A
        A -= 1
    elif A < B:
        cnt += B
        B -= 1
    else:
        cnt += A #同じとき
        A -= 1

print(cnt)

Submission status: Accepted

Solution code:
# 整数の入力
A, B = map(int, input().split() )
## input_line = str(input())
## A, B = map(int, input_line.split() )


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

print(str(result))

Submission status: Accepted

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

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

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 += b
        b-=1
    else:
        sum += a
        a-=1

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for j in range(2):
    if B[0] > B[1]:
        coin += B[0]
        B[0] -= 1
    else:
        coin += B[1]
        B[1] -= 1
    
print(coin)

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i,temp in enumerate(arr):
  arr[i] = int(arr[i])
  
result = 0
for i in range(2):
  result += max(arr)
  index = arr.index(max(arr))
  arr[index] = arr[index] -1
  
print(result)

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


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

print(ans+max(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
A, B = input().split()
A, B = int(A), int(B)
list = [A, B]
s = max(list)
b = max(list) - 1
h = list.index(max(list))
del list[h]
list.append(b)
s = s + max(list)
print(s)