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:
import sys

# 文字の読み込み
st = input().split()

fl = [ int(x) for x in st]

num_sum = 0

# 作業を2回繰り返す
for k in range(2):
    if fl[0] >= fl[1]:
        i = 0
    else:
        i = 1

    num_sum += fl[i]
    fl[i] -= 1

print(num_sum)

Submission status: Accepted

Solution code:
# coding:utf-8

a,b = map(int, input().split())
x = 0
for i in range(2):
	if a>=b : 
		x=x+a
		a=a-1
	elif a<b :
		x=x+b
		b=b-1
print(x)

Submission status: Accepted

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

Submission status: Accepted

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

final = 0
if a > b:
    final += a
    a -= 1
    final += a if a > b else b
else:
    final += b
    b -= 1
    final += a if a > b else b

print(final)

Submission status: Accepted

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

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

print(x+y)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Input
list = [int(a) for a in input().split()]

#ソート
list.sort()

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

print(num)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split(' ')))
l.sort()
tmp = l[1]
if (l[1]-1<l[0]):
    print(l[1]+l[0])
elif(l[1]==l[0]):
    print(l[0]+l[1])
else :
    print(l[1]*2-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def solve(a, b):
    x = max(a, b)
    y = min(a, b)
    if x > y + 1:
        return 2 * x - 1
    else:
        return x + y

if __name__ == '__main__':

    a, b = sys.stdin.readline().strip().split(" ")
    ans = solve(int(a), int(b))
    print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

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)

	
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if(l[0] - l[1] >= 2):
    print(l[0] + l[0] - 1)
else:
    print(l[0] + l[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:
nums_str = input()
nums_str_arr = nums_str.split(' ')
a = int(nums_str_arr[0])
b = int(nums_str_arr[1])

sum_score = 0

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

print(sum_score)

Submission status: Accepted

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

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

Submission status: Accepted

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

l_button = max([a,b])

if a == b:
  l_button += l_button
else:  
  l_button += (l_button-1)

print(l_button)

Submission status: Accepted

Solution code:
inputlist = input().split()
a = int(inputlist[0])
b = int(inputlist[1])
answer = 0
for _ in range(2):
    if a < b:
        answer += b
        b -= 1
    else:
        answer += a
        a -= 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input = input()
splitedinput = input.split(" ")
num1 = int(splitedinput[0])
num2 = int(splitedinput[1])
if num1 < num2:
  num3 = int(num2) - int(num1)
elif int(num2) < int(num1):
  num3 = int(num1) - int(num2)
elif num2 == num1:
  num3 = 0
if num3 >= 2:
  toadd = max(num1, num2)
  result = toadd * 2
  result = int(result) - 1
  print(result)
else:
  result = num1 + num2
  print(result)

Submission status: Accepted

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

if coin_a == coin_b:
    print(coin_a + coin_b)
elif coin_a > coin_b:
    print((coin_a * 2) - 1)
else:
    print((coin_b * 2) - 1)

Submission status: Accepted

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

Submission status: Accepted

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

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:
button=list(map(int, input().split()))
button.append(button[0]-1)
button.append(button[1]-1)
button.sort(reverse=True)
print(button[0]+button[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:
button = [int(i) for i in input().split()]
ans = 0
for i in range(2):
    if button[0] > button[1] or button[0] == button[1]:
        ans += button[0]
        button[0] -= 1
    else:
        ans += button[1]
        button[1]-= 1


print(ans)

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:
#coding: utf-8

a, b = list(map(int, input().rstrip().split(' ')))
result = 0

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

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
x = input().split()
y = np.empty(2)
y[0] = int(x[0])
y[1] = int(x[1])
max = 0
if y[0] >= y[1]:
    max += y[0]
    y[0] = y[0] - 1
else:
    max += y[1]
    y[1] = y[1] -1

if y[0] >= y[1]:
    max += y[0]
else:
    max += y[1]
print(int(max))

Submission status: Accepted

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

Submission status: Accepted

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

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

elif a<b and a<=b-1:
    print(b+b-1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math


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())
X = max(A,B)
Y = min(A,B)
if X+Y >= 2:
    print(max(A,B)+max(max(A,B)-1,min(A,B)))
else:
    print(X+Y)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

# In[5]:


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


# In[7]:


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


# In[ ]:

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().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,input().split())
ans = max(a+b,a+a-1,b+b-1,a+b-1,a-1+b)
print(ans)

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=list(map(int,input().split(" ")))
x,y=sorted(a)
if(y-1>x):
    print(y+y-1)
else:
    print(y+x)

Submission status: Accepted

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    token = lines[0].split()
    a = int(token[0])
    b = int(token[1])

    return (a, b)


def solve(a, b):

    if debug:
        log("a=%s" % a)
        log("b=%s" % b)
        
    tmp_a = a
    tmp_b = b

    result = 0
    for i in range(2):
        if tmp_a > tmp_b:
            result = result + tmp_a
            tmp_a = tmp_a - 1
        else:
            result = result + tmp_b
            tmp_b = tmp_b - 1

    return result


def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

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:
l = map(int, raw_input().split());
ans = 0;

if (l[0] == l[1]):
	ans = l[0] + l[1];

elif(l[0] > l[1]):
	if (l[0] == 1):
		ans = l[0];
	else:
		ans = l[0] + l[0] - 1;

else:
	if (l[1] == 1):
		ans = l[1];
	else:
		ans = l[1] + l[1] - 1;

print ans;

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());n=max(a,b);print(2*n-1 if abs(a-b)>0 else 2*n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
##  input functions for me
def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##

## main ##
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:
# coding: utf-8

alpha = list(map(int, input().split()))
sum = 0

for i in range(2):
  if alpha[0] > alpha[1]:
    sum += alpha[0]
    alpha[0] -= 1
  else:
    sum += alpha[1]
    alpha[1] -= 1
    
print(sum)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res = max([A, B])
if A >= B:
    A -= 1
else:
    B -= 1

res += max([A, B])
print(res)

Submission status: Accepted

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

z = 0
if x > y:
    z+= x
    x -= 1
else:
    z+=y
    y -= 1
if x > y:
    z+= x
    x -= 1
else:
    z+=y
    y -= 1
print(z)

Submission status: Accepted

Solution code:
# 1行に複数の数値を入力する場合

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

print(x)

Submission status: Accepted

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

if a==b:
  print(a+b)

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

if a<b:
  print(2*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:
#!/usr/bin/env python3

a = []

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

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

print(coin)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
a, b = map(int, input().split())
cnt = 0
if a > b:
    cnt += a
    a -= 1
else:
    cnt += b
    b -= 1
cnt += max(a, b)
print(cnt)

Submission status: Accepted

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

score = 0

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

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

print(score)

Submission status: Accepted

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

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

print v

Submission status: Accepted

Solution code:
inp = []
ii = input().split()
if int(ii[0]) > int(ii[1]):
    re = int(ii[0])  * 2 -1
elif int(ii[0]) < int(ii[1]):
    re = int(ii[1])  * 2 -1
else:
    re = int(ii[0])  * 2
print(re)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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 = list(map(int,input().split()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A == B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])
 
A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)
 
print(result_1 + result_2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import itertools

a, b = map(int, input().rstrip().split())
l = [a, b, a-1, b-1]
comb = list(itertools.combinations(l, 2))
sum_comb = list(map(sum, comb))
out = max(sum_comb)
print(out)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(COIN)

Submission status: Accepted

Solution code:
from sys import stdin

a, b = stdin.readline().rstrip().split()

a = int(a)
b = int(b)

sum = 0

sum += max(a, b)

if sum == a:
    a -= 1
else:
    b -= 1

sum += max(a, b)

print(sum)

Submission status: Accepted

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

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:
#https://atcoder.jp/contests/abc124
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
inputs = [int(i) for i in input().split()]
res = 0
res += max(inputs)
max_idx = inputs.index(max(inputs))
inputs[max_idx] -= 1
res += max(inputs)
print (res)

Submission status: Accepted

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

if a - b == 0:
    sum = a+b
elif a+1 > b:
    sum = a+(a-1)
elif a - b == 1 or b - a == 1:
    sum = a+b
else:
    sum = b+(b-1)

print(sum)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
button = input().split()
button_1 = int(button[0]) 
button_2 = int(button[1]) 

counter = 0
#1st time
if button_1>=button_2:
  counter=button_1
  button_1-=1
else:
  counter=button_2
  button_2-=1

#2nd time
if button_1>=button_2:
  counter+=button_1
  button_1-=1
else:
  counter+=button_2
  button_2-=1

print(counter)

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

Submission status: Accepted

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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import itertools
import copy


def makeIntMatrix(lines):
    intMatrix = []
    for a in makeStringMatrix(lines):
        intMatrix.append([int(b) for b in a])
    return intMatrix
 
 
def makeStringMatrix(lines):
    stringMatrix = [line.split() for line in lines]
    return stringMatrix
 
 
def makeInt(line):
    return int(line.rstrip())
 
 
def makeMultiInteger(line):
    return [int(x) for x in line.rstrip().split()]


def solve(input_string):
    a = makeMultiInteger(input_string[0])
    _max = 0
    two = copy.deepcopy(a)
    c = two[0]
    two[0] -= 1
    c += two[0]
    two[0] -= 1
    if _max < c:
        _max = c

    two = copy.deepcopy(a)
    c = 0
    c = two[0]
    two[0] -= 1
    c += two[1]
    two[1] -= 1
    if _max < c:
        _max = c

    two = copy.deepcopy(a)
    c = 0
    c = two[1]
    two[1] -= 1
    c += two[1]
    two[1] -= 1
    if _max < c:
        _max = c
    return _max


def main():
    input_lines = stdin.readlines()
    answer = solve(input_lines)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
#input
[A,B] = list(map(int,input().split()))
#[A,B] = [5,5]
ans = 0
if A == B:
    ans = 2*A
else:
    ans = 2*max(A,B) - 1
print(ans)

Submission status: Accepted

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

total = 0

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

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

print(total)

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:
def main():
    A, B = map(int, input().split())
    X = 0

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

    print(X)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
max1 = max(a, b)
if a == max1:
    a -= 1
elif b == max1:
    b -= 1
max2 = max(a, b)

print(max1 + max2)

Submission status: Accepted

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


sa=n[0]-n[1]
saa=abs(sa)

if saa>=2:
  tokuten=iti*2-1
else:
  tokuten=sum(n)


print(tokuten)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
if(a>b): print(a*2-1)
elif(a<b): print(b*2-1)
elif(a==b):print(a*2)

print()

Submission status: Accepted

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

Submission status: Accepted

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

total = 0

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
coins=0
if x>y:
    coins+=x
    if x-1>y:
        coins+=x-1
    else:
        coins+=y
else:
    coins+=y
    if x>y-1:
        coins+=x
    else:
        coins+=y-1
print(coins)

Submission status: Accepted

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

int(A)
int(B)
sum = 0

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

print(sum)

Submission status: Accepted

Solution code:
def split_returner(chardata):
        chardata = str(chardata).split(" ")
        for i in range(0,len(chardata)):
            chardata[i] = int(chardata[i])
        return chardata

ab = split_returner(str(input()))
result = 0
for i in range(0,2):
    if ab[0] > ab[1]:
        result+= ab[0]
        ab[0] = ab[0] -1
    else:
        result += ab[1]
        ab[1] = ab[1] - 1
print(result)

Submission status: Accepted

Solution code:
import sys

def ii2ss(n):
    return [sys.stdin.readline() for _ in range(n)]

def sp2nn(sp, sep=' '):
    return [int(s) for s in sp.split(sep)]

def ss2nn(ss):
    return [int(s) for s in list(ss)]

def main(ss):
    a, b = sp2nn(ss[0])
    if a > b:
        print(a + (a-1))
    elif a < b:
        print(b + (b-1))
    else:
        print(a + b)

main(ii2ss(1))

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

Submission status: Accepted

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

pattern1 = A+A-1
pattern2 = A+B
pattern3 = B+B-1

print(max(pattern1, pattern2, pattern3))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(item) for item in 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:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 20:00:11 2019

@author: screamLab
"""

a,b = input().split(' ')
a = int(a)
b= int(b)
s = [a+b,a-1+a,b-1+b]
    
print(max(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a==b:
    print(a*2)
else:
    maxx = max(a, b)
    print(maxx + (maxx - 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:
A, B = (int(i) for i in input().split())
result = 0
cnt = 0
while(cnt < 2):
    if A < B:
        result += B
        B = B - 1
    elif A > B:
        result += A
        A = A - 1
    else:
        result += A
    cnt += 1
    
print(result)

Submission status: Accepted

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

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

if A>=B:
    second = A
else:
    second = B

print(first+second)

Submission status: Accepted

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

aa = 2*a - 1
ab = a + b
bb = 2*b - 1

print(max(aa, ab, bb))

Submission status: Accepted

Solution code:
num = input()
num_list = num.split()
a = int(num_list[0])
b = int(num_list[1])
_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:
# coding: utf-8

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

if abs(a-b) >= 1:
    print(max([a, b]) * 2 - 1)
else:
    print(max([a, b]) * 2)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
#coding:utf-8

if __name__ == "__main__":
    A, B = map(int, input().split())
    total = 0
    for n in range(2):
        if A < B:
            total += B
            B = B - 1
        else:
            total += A
            A = A - 1
    
    print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]

res = 0

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

print(res)

Submission status: Accepted

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