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 = input().split()
a, b = int(a), int(b)
total = 0
if a > b :
  total = 2*a -1 

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


  
if a == b:
  total = 2*a

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

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)

Submission status: Accepted

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

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

print(coins)

Submission status: Accepted

Solution code:
def sub():
    A, B = [int(e) for e in input().split(" ")]
    N = 0
    for _ in range(2):
        if A > B:
            N = N + A
            A = A -1
        else:
            N = N + B
            B = B - 1
    print("{}".format(N))

sub()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

def solve(nums):
    a, b = nums
    p = 0
    for i in range(2):
        if a < b:
            p = p + b
            b = b - 1
        else:
            p = p + a
            a = a - 1
    return p


def main():
    nums = [int(n) for n in stdin.readlines()[0].split(' ')]
    p = solve(nums)
    print(p)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m = [ int(s) for s in input().split(" ") ]
x = 0

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

print(x)

Submission status: Accepted

Solution code:
def solve(a, b):
  return max(a*2-1, a+b, b*2-1)

def main():
  a, b = map(int, input().split())
  
  ans = solve(a, b)
  print(ans)

main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#Coding= Utf-8

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

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

Submission status: Accepted

Solution code:
args = input()
args = args.split(' ')

a = int(args[0])
b = int(args[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(max_number+max(max_number-1,min_number))

Submission status: Accepted

Solution code:
import sys

#a=int(input())
#b=int(input())
a,b=map(int,input().split())
ans=0
i=2
while i>0:
    if(a>b):
        ans+=a
        a=a-1
        #print(a)
    elif(b>a):
        ans+=b
        b=b-1
    else:
        ans+=a
        a=a-1
    i=i-1
print(ans)

Submission status: Accepted

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

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())
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:
def main():
    a, b = [int(i) for i in input().split()]
    ans = max(a,b)
    ans += max(max(a,b)-1, min(a,b))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding:UTF-8

# ２つのボタンのコイン獲得枚数を取得
buttons = list(map(int, input().split()))

# 最大獲得コイン取得用領域
max_coin = 0

for _ in range(2):
    if buttons[0] > buttons[1]:
        max_coin += buttons[0]
        buttons[0] -= 1
    else:
        max_coin += buttons[1]
        buttons[1] -= 1

# 結果出力
print(max_coin)

Submission status: Accepted

Solution code:
[A,B] = [int(e) for e in 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())
ans = 0

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

print(ans)

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

if (a[0] == a[1]):
  print(a[0]*2)
else:
  bigger = max(a[0], a[1])
  print(2 * bigger -1)

Submission status: Accepted

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

slice = sorted([A, A-1, B, B-1])[-2:]
print(sum(slice))

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())
rslt = 0

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

print(rslt)

Submission status: Accepted

Solution code:

l = list(map(int, input().split(' ')))
A = l[0]
B = l[1]
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:
if __name__ == '__main__':                                                                                                                                   
    A,B = list(map(int,input().split()))                                                                                                                     
    N = 2                                                                                                                                                    
                                                                                                                                                             
    a,b = A,B                                                                                                                                                
                                                                                                                                                             
    res = 0                                                                                                                                                  
    for x in range(N):                                                                                                                                       
        if a>b:                                                                                                                                              
            res = a+res                                                                                                                                      
            a = a-1                                                                                                                                          
        else:                                                                                                                                                
            res = b+res                                                                                                                                      
            b = b-1                                                                                                                                          
                                                                                                                                                             
    print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

if p1 > a + b:
    print p1
else:
    print a+b

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = map(int,input().split())
a = list(a)
k = 0
for i in range(2):
    if a[0] > a[1]:
        k += a[0]
        a[0] += -1
    elif a[0] < a[1]:
        k += a[1]
        a[1] += -1
    else:
        k += a[0]
        a[0] += -1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

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())
n = 2
x = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


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

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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


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

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    buttons = list(map(int, input().split()))
    coin = 0

    max_index = buttons.index(max(buttons))
    coin += max(buttons)
    buttons[max_index] -= 1
    coin += max(buttons)

    print(coin)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
A_A = A + A - 1
A_B = A + B
B_B = B + B - 1
list = [A_B, A_A, B_B]
list.sort(reverse=True)
print(list[0])

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

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputs = list(map(int, input().split()))
max = []

if inputs[0] > inputs[1]:
    max.append(inputs[0])
    inputs[0] = inputs[0] - 1
else:
    max.append(inputs[1])
    inputs[1] = inputs[1] - 1

if inputs[0] > inputs[1]:
    max.append(inputs[0])
    inputs[0] = inputs[0] - 1
else:
    max.append(inputs[1])
    inputs[1] = inputs[1] - 1

print(max[0]+max[1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
A - Buttons
https://atcoder.jp/contests/abc124/tasks/abc124_a

"""
import sys


def solve(A, B):
    return max(A+B, A+A-1, B+B-1)


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[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())
if a==b:
  print(2*a)
else:
  if a<b:
    print(b+(b-1))
  else:
    print(a+(a-1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(coins)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    max_ = max(A, B)
    print(A * 2 if A == B else max_ * 2 - 1)


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

large_1=max(A,B)
small_1=min(A,B)
a = large_1-1

large_2 = max(a,small_1)

print(large_1+large_2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if(b > c):
    total += b
    b -= 1
else:
    total += c
    c -= 1

print(total)

Submission status: Accepted

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

# s = 0
# for _ in range(2):
#     if A >= B:
#         s += A
#         A -= 1
#     else:
#         s += B
#         B -= 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
a,b=map(int, input().split())

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

Submission status: Accepted

Solution code:
def solve():
    A, B = [int(_) for _ in raw_input().split()]
    ret = max(2*A - 1, A + B, 2*B-1)
    print str(ret)

if __name__ == '__main__':
    solve()

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) * 2 - (1 if A != B else 0))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

A, B = map(int, input().split())
Max = max(A, B)
Min = min(A, B)
Sum = Max + max(Max - 1, Min)
print(Sum)

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

Submission status: Accepted

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

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:
A, B = map(int, input().split())
nums = [A, B]
nums.sort()
ans = 0
cnt = 0
while cnt < 2:
    ans += nums[-1]
    nums[-1] -= 1
    nums.sort()
    cnt += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
# coding: utf-8
# Your code here!
i = list(map(int, input().split()))
if i[1] == i[0]:
    print(i[0]+i[1])
elif i[0]-1 >= i[1]:
    print(i[0]*2-1)
else:
    print(i[1]*2-1)

Submission status: Accepted

Solution code:
s = list(map(int, input().split())) 
 
s_1 = sorted(s)
s_2 = sorted([s_1[0], s_1[1]-1])
A = s_1[1] + s_2[1]
 
print(A)

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

s_1 = sorted(s)
s_2 = sorted([s_1[0], s_1[1]-1])
A = s_1[1] + s_2[1]
 
print(A)

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

A=int(A)
B=int(B)
X=A+A-1
Y=B+B-1
Z=A+B
print(max(X,Y,Z))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = list(map(int,input().split()))
X = 0
 
for i in range(2):
  X += A[A[1] > A[0]]
  A[A[1] > A[0]] -= 1
  
print(X)

Submission status: Accepted

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

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
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())
l = [a,a-1,b,b-1]
l = sorted(l)
print(sum(l[-2:]))

Submission status: Accepted

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

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

print(point)

Submission status: Accepted

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

Submission status: Accepted

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

def main(A, B):
    if(A<=B-1):
        print(2*B-1)
    elif(A==B):
        print(2*B)
    else:
        print(2*A-1)
            

if __name__ == '__main__':
    A, B = map(int, input().split())
    
    main(A, B)

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

sum = 0
for _ in range(2):
  sum += i[i.index(max(i))]
  i[i.index(max(i))] -= 1

print(int(sum))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

lst.sort(reverse=True)
total = lst[0]
lst[0] = total - 1
lst.sort(reverse=True)
total += lst[0]

print(total)

Submission status: Accepted

Solution code:
inputList = [int(i) for i in input().split()]
res = 0

for i in range(2):
    inputList.sort(reverse=True)
    res += inputList[0]
    inputList[0] -= 1

print(res)

Submission status: Accepted

Solution code:
a, b = (int(x) for x in 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(" "))
n=0
for i in range(2):
  if A>=B:
    n+=A
    A-=1
  elif B>=A:
    n+=B
    B-=1
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split(" "))
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 = [int(x) for x in input().split()]

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

print(coin)

Submission status: Accepted

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

# coding: utf-8

# In[3]:

import sys
#input = sys.stdin.readline
A, B = map(int, input().split())
#A = list(map(int, input().split()))


# In[4]:

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


# In[ ]:

Submission status: Accepted

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

Submission status: Accepted

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

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

s = 0
if(larger<=lesser):
    s = 2*larger
else:
    s = 2*larger-1

print(s)

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