Problem:


Score : 100 points

Problem Statement

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

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

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

At most how many coins can you get?

Constraints

All values in input are integers.

3 \leq A, B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

Print the maximum number of coins you can get.

Sample Input 1

5 3

Sample Output 1

9

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

Sample Input 2

3 4

Sample Output 2

7

Sample Input 3

6 6

Sample Output 3

12



Sample input:
5 3


Sample output:
9

Submission status: Accepted

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

Submission status: Accepted

Solution code:


l = [int(x) for x in input().split()]

maxx = max(l)
minn = min(l)

if(maxx == minn):
	print(2*maxx)
else:
	print(2*maxx -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())
res = 0
if a == b :
    res = 2 * a
elif a > b :
    res = 2 * a -1
else :
    res = 2 * b - 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

A, B = LI()

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

Submission status: Accepted

Solution code:
ar = []                                            
raw = raw_input().split()                          
#ar.append(int(raw))                               
#raw = raw_input()                                 
#raw = raw_input()                                 
#ar.append(int(raw))                               
#raw = raw_input()                                 
#ar.append(int(raw))                               
#raw = raw_input()                                 
#ar.append(int(raw))                               
#raw = raw_input()                                 
#ar.append(int(raw))                               




#n = ar[0]                                         
a = int(raw[0])                                    
b = int(raw[1])
#c = ar[3]
#d = ar[4]
#e = ar[5]                                         

first = max(a,b)                                   

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


second = max(a,b)                                  

print first + second

Submission status: Accepted

Solution code:
import sys
import io
import math
import re

datalist = input().split()
data_a = int(datalist[0])
data_b = int(datalist[1])


if data_a - data_b >= 2:
  print(data_a*2-1)
elif data_b - data_a >= 2:
  print(data_b*2-1)
else:
  print(data_a+data_b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

g = 0
p = ''

if (A >= B):
	p = 'A'
	g = g + A
	A = A - 1
else:
	p = 'B'
	g = g + B
	B = B - 1

if (A >= B):
	p = 'A'
	g = g + A
	A = A - 1
else:
	p = 'B'
	g = g + B
	B = B - 1

print(g)

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
count = 0
for i in range(2):
  if a == max(a,b):
    count += a
    a -= 1
  else:
    count += b
    b -= 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

x = 0

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

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

print(x)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().strip().split(" ")))
s1 = a+a-1
s2 = a+b
s3 = b+b-1
print(max(s1,s2,s3))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(s) for s in input().split()]
if A > B:
    print(A + A - 1)
elif B > A:
    print(B + B - 1)
else:
    print(2 * A)

Submission status: Accepted

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

Submission status: Accepted

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

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

sum = 0
for i 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:
a,b = (int(i) for i in input().split())
h = 0

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

if a > b:
  print(h+a)
else:
  print(h+b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
python3 a.py < input.txt
"""
import math
import itertools as it
import heapq

A,B=map(int,input().split())
x=0
if A<B:
    x+=B
    B=B-1
else:
    x+=A
    A=A-1

print(x+max([A,B]))

Submission status: Accepted

Solution code:
a, b = list(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:
import sys

A, B = map(int, sys.stdin.readline().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

C=0
if(A>=B):
    C += A
    A = A-1
else:
    C += B
    B = B-1
if(A>=B):
    C += A
    A = A-1
else:
    C += B
    B = B-1

print(C)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#n=int(input())
#s=input()
a,b=map(int,input().split())
#A=[list(map(int,input().split()))for i in range(n)]
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 = list(map(int, input().split()))
if (a[0] == a[1]):
  print(2 * a[0])
elif (abs(a[0] - a[1]) >= 2):
  print(2 * max(a) - 1)
else:
  print(sum(a))

Submission status: Accepted

Solution code:
a, b = [int(x) for x 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())
ans = 0
for x 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())
A, B = (A, B) if A > B else (B, A)
print(A + max(A - 1, B))

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
cnt = 0
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())
x=0
for i in range(2):
    if A>=B:
        x=x+A
        A=A-1
    else:
        x=x+B
        B=B-1

print(x)

Submission status: Accepted

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


x = a+b
y = a+a-1
z = b+b-1

list = [x,y,z]

max = max(list)


print(max)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0,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
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())
value = 0
for n in range(2):
    value += max(A,B)
    if A>B:
        A=A-1
    else:
        B=B-1
print(value)

Submission status: Accepted

Solution code:
def button(a):
    if max(a)*2-1>sum(a):
        return max(a)*2-1
    else:
        return sum(a)
a=list(map(int,input().split()))
print(button(a))

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:
tmp=input().split(" ")
a = int(tmp[0])
b = int(tmp[1])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

Solution code:
import sys
# import bisect
# import math
# import itertools
# import numpy as np
# import collections

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e, p = range, enumerate, print
    ip = IP()
    id = Idea()
    mod = 10 ** 9 + 7

    """この下から書いてね"""
    a, b = ip.IL()
    ans = 0
    if a > b:
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1

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


main()

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
r = 0
for _ 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(" "))
if a == b:
  print(a * 2)
elif a < b:
  print(b * 2 - 1)
else:
  print(a * 2 - 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]

if ( a==b ):
  print("{0}".format(a+b))
elif ( a<b ):
  print("{0}".format(2*b-1))
else:
  print("{0}".format(2*a-1))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
A, B = tuple(li())
if A == B:
    print(A * 2)
else:
    C = max(A, B)
    print(2*C -1)

Submission status: Accepted

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

print(max(max(sum(a),a[0]*2-1),a[1]*2-1))

Submission status: Accepted

Solution code:
# coding: utf-8
AB = input().split()
A = int(AB[0])
B = int(AB[1])
ans = 0
if A>B:
  ans +=A
  A = A -1
else:
  ans +=B
  B = B -1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    result = sub()
    print(result)


def sub():
    a, b = [int(x) for x in (input().split())]
    result = 0
    if a > b:
        result += a
        a = a - 1
    else:
        result += b
        b = b - 1

    if a > b:
        result += a
        a = a - 1
    else:
        result += b
        b = b - 1
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

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

A, B = map(int, input().rstrip().split())
sum = 0

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

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sumn)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = tuple([int(x) for x in 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())
if a == b :
    print(2*a)
else:
    max = max([a,b])
    print(2*max-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = [int(a) for a in input().split()]
print(max(li) + max(li) - 1) if li[0]!=li[1] else print(max(li)*2)

Submission status: Accepted

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

    print(ans)

Submission status: Accepted

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


c = 0
for i in range(2):
    j = max(A)
    ind = A.index(j)
    c += j
    A[ind] -= 1

print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

get_coin = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

a, b = na()

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:
a, b = map(int,open(0).read().split())

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