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:
#!/usr/bin/env python3

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

n=0
n+=M
M-=1

n+=max(M,m)

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

M = max(a,b)
m = min(a,b)

n = 0
n += M

M -= 1

n += max(M,m)

print(n)

Submission status: Accepted

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

coinGainList = []

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

Submission status: Accepted

Solution code:

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

res = 0
if a < b:
    res = 2 * b - 1
elif a == b:
    res = 2 * a
else:
    res = 2 * a - 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c=[int(i) for i in input().split()]
print(max(sum(c),2*max(c)-1))

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:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

def main():
    A,B=mi()
    print(max(A+B,A+A-1,B+B-1))

                





if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B = LI()

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

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    a, b = nm()
    c = max(a, b)
    d = max(c - 1, min(a, b))
    print(c + d)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans + max(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

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

res = max(2*a - 1, a + b, 2*b - 1)

print(res)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = max(a+b, 2*a-1, 2*b-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:
a, b = list(map(int, input().split()))
if a == b:
  my_result = a + b
elif a > b:
  my_result = 2 * a - 1
else:
  my_result = 2 * b - 1
print(my_result)

Submission status: Accepted

Solution code:
a,b=list(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())
botan = [A, A-1, B, B-1]
botan.sort()
print(botan[-1]+botan[-2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
num=0
c=max(a,b)
d=min(a,b)
num+=c
num+=max(c-1,d)
print(num)

Submission status: Accepted

Solution code:
N=sorted(list(map(int,input().split())))
A=N[0]
B=N[1]
if A==B:
    print(A+B)
else:
    print(B+B-1)

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())
res = sorted([A,A-1,B,B-1],reverse=True)
print(res[0]+res[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
ans += max(a, b)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc124_a.py
# https://atcoder.jp/contests/abc124/tasks/abc124_a

# A - Buttons /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 2個のボタンがあり、大きさはそれぞれ A,Bです。
# 大きさ Xのボタンを押すと、X 枚のコインを獲得し、そのボタンの大きさが 1小さくなります。
# あなたは、いずれかのボタンを押すことを 2回行います。 同じボタンを 2回押しても構いません。
# 最大で何枚のコインを獲得できるでしょうか。

# 制約
#     入力は全て整数である。
#     3≤A,B≤20

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A B

# 出力
# 獲得できるコインの枚数の最大値を出力せよ。

# 入力例 1
# 5 3

# 出力例 1
# 9

# 大きさ 5のボタンを 2 回押すと 5+4=9枚のコインが獲得でき、これが最大です。

# 入力例 2
# 3 4

# 出力例 2
# 7

# 入力例 3
# 6 6

# 出力例 3
# 12


def log(line):
    if False:
        print(line)


def calculation(lines):
    # line = lines[0]
    # N = int(lines[0])
    A, B = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[1].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(Q):
    #     valueses.append(list(map(int, lines[i+1].split())))

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

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['5 3']
        lines_export = [9]
    if pattern == 2:
        lines_input = ['3 4']
        lines_export = [7]
    if pattern == 3:
        lines_input = ['6 6']
        lines_export = [12]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

A,B = MI()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l.sort()

if  l[0] != l[1]:
    print((l[1] * 2 ) - 1)

elif l[0] == l[1]:
    print(l[1] * 2)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	#a = int(input())
	b , c = tin()
	#s = input()
	ret = max(b+c,b+b-1, c+c-1)
	print(ret)
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
#押すのはa-a,b-b,a-bのうちのいずれか
print(max(2*a-1,2*b-1,a+b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def push(X):
    coin=X
    X-=1
    return X,coin
A,B=map(int,input().split())
coin=0
if A>B:
    A,coin=push(A)
else:
    B,coin=push(B)
if A>B:
    coin+=A
else:
    coin+=B
print(coin)

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

print(2*max(A, B) - (A != B))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(Ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = max(a+b,a+a-1,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 -= 1
    else:
        ans += b
        b -= 1

print(ans)

Submission status: Accepted

Solution code:
List = list(map(int, input().split()))
List.sort()
res = 0
for i in range(2):
  a= List.pop(1)
  res += a
  List.append(a-1)
  List.sort()
print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
if not ( 3 <= A <= 20 and 3 <= B <= 20 ): sys.exit()

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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

else:
  print(a+a-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

if A == B:
    print(A+B)
elif 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(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:
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:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b = map(int, input().split())
    ans = 0
    i = 0
    while i < 2:
        if a >= b:
            ans += a
            a -= 1
        else:
            ans += b
            b -= 1
        i += 1
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if a == b:
	print(a+b)
elif a > b:
	c = a
	a = a - 1
	d = max(a,b)
	c += d 
	print(c)
elif a < b:
	c = b
	b = b - 1
	d = max(a,b)
	c += d 
	print(c)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

c = a - 1
d = b - 1

print(max(a + c, b + d, a + b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

list = [(2*A-1), (A+B), (2*B-1)]

print(max(list))

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

X = max(A, B)

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = (int(X) for X in input().split())
print(max(2*A-1,2*B-1,A+B))

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:
import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())
a, b = rm()
if a == b:
  print(a*2)
else:
  print(max(a, b)*2-1)

Submission status: Accepted

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

Submission status: Accepted

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

while counter < 2:
  if a >= b:
    coin += a
    a -= 1
  else:
    coin += b
    b -= 1
  counter += 1
print(coin)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = 0
i = 1
while i <= 2:
  
  if a > b:
    ans+=a
    a-=1
  else:
    ans+=b
    b-=1
  i+=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
  else:
    ans += b
    b -= 1
print(ans)

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

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

PB =[A, B]

L_PB = max(PB)
S_PB = min(PB)

coin1 = L_PB

L_PB -= 1

if S_PB <= L_PB:
    coin2 = L_PB

else:
    coin2 = S_PB

print(coin1 + coin2)

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 = sorted(list(map(int, input().split())), reverse=True)
print(A[0]*2 if A[0] == A[1] else A[0]+(A[0]-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(c+max(a, b))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
a, b = map(int, input().split())
#s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 124-A

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

cnt = 0
l = sorted(list(map(int, input().split())), reverse=True)

cnt = cnt + l[0]

l[0] = l[0] - 1

l = sorted(l, reverse=True)

cnt = cnt + l[0]

print(cnt)

Submission status: Accepted

Solution code:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

A, B = MI()

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

Submission status: Accepted

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

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

Submission status: Accepted

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