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:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 09:52:51 2019

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


"""
N, X = map(int, input().split())

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

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

#setの宣言
opn = set()
opn.add(start)
opn.remove(start)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

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

def main():    
    print(max(A+A-1, A+B, B+B-1))    
 
if __name__ == '__main__':
    main()

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

ans += max(a, b)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

score = 0

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

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

print(score)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
AB = [int(i) for i in input().split()]
output = 0
for i in range(2):
    AB.sort(reverse = True)
    output += AB[0]
    AB[0] -= 1

print(output)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

out = 0
for _ 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*B-1)
elif A == B:
    print(2*A)
else:
    print(2*A-1)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
if abs(A-B) == 0:
  ans = A+B
else:
  ans = max(A,B) + max(A,B)-1
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
# import math
# import numpy as np
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = [int(x) for x in stdin.readline().rstrip().split()]
A, B = [int(x) for x in stdin.readline().rstrip().split()]

if A == B:
  print(A*2)
elif A>B:
  print(2*A-1)
else:
  print(2*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:
x,y = map(int, input().split())
ans = 0

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

print(ans)

Submission status: Accepted

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

ans = 0

for i in range(2) :
    if max(A, B) == A :
        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:
def load_input():
    a, b = list(map(int, input().split()))
    return a, b


def main():
    a, b = load_input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = 0

for _ in range(2):
  ans += max(a)
  if a[0] == max(a):
    a[0] -= 1
  else:
    a[1] -= 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 = (int(i) for i in 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:
  ans=2*A
else:
  ans=max(A,B)*2 - 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(coin)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X, Y = list(map(int, input().split(' ')))
print(max(X, Y)*2-1 if abs(X-Y) >= 2 else X+Y)

Submission status: Accepted

Solution code:


def main(m):
    a, b = list(map(int, m.split(' ')))
    if a > b:
        print(int(a + max(a - 1, b)))
    else:
        print(int(b + max(a, b - 1)))
        
if __name__ == '__main__':
    try:
        m = input().strip()
        main(m)
    except EOFError:
        pass

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:
# coding: utf-8
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 + max(a-1, b))
else:
    print(b + 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())
if a>b:
    print(a*2-1)
elif b>a:
    print(b*2-1)
else:
    print(a+b)

Submission status: Accepted

Solution code:
#coding: utf-8
A, B = map(int, input().split())
ans = 0
for i in range(2):
    ans += max(A, B)
    if A > B:
        A -= 1
    else:
        B -= 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding:utf-8

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

if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(score)

Submission status: Accepted

Solution code:
# 2019/04/13
# AtCoder Beginner Contest 124 - A

# Input
a, b = map(int,input().split())
sum = 0

# Calc
if a > b:
    sum = a
    a -= 1
else:
    sum = b
    b -= 1

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

# Output
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
ans+=max(A,B)
if A >= B:
    A=A-1
else:
    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 + a-1)
elif a == b:
    print(a + b)
elif a < b:
    print(b + b-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

X = 0
if A > B:
    X = X + A
    A = A - 1
else:
    X = X + B
    B = B - 1
X = X + max(A, B)

print(X)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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 += A
        A -= 1
    else :
        sum += B
        B -= 1
print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

sum_ab = A + B
sum_aa = A + A-1
sum_bb = B + B-1

print(max(sum_ab, sum_aa, sum_bb))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=x
x-=1
ans+=max(x,y)
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:
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

a,b = na()

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

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  A, B = readInts()
  ans = 0
  if A >= B:
    ans += A
    A -= 1
  else:
    ans += B
    B -= 1

  ans += max(A, B)
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

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

print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

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

else:
    ans+=b

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
coin = 0
for _ in range(2):
    coin += max([A, B])
    A, B = max([A, B]) - 1, min([A, B])
print(coin)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print(j)

Submission status: Accepted

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

ans = max(A,B)
if A >= B:
    A -= 1
else:
    B -= 1
ans += max(A,B)

print(ans)

Submission status: Accepted

Solution code:
from heapq import heappush,heappop

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))




def ans():
    A ,B = ints_raw()
    ans =0
    for i in range(2):
        if A>B:
            ans += A
            A-=1
        else:
            ans+=B
            B-=1
    return ans

print(ans())

Submission status: Accepted

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# List should include values line-by-line
a, b = list(map(int, input().split()))     # inline input

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list=input().split(" ")
x=int(list[0])
y=int(list[1])

sum=0

if x>y:
    sum+=x
    x-=1
else:
    sum+=y
    y-=1

if x>y:
    sum+=x
    x-=1
else:
    sum+=y
    y-=1

print(sum)

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

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

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

out=0

if A>B:
    out=2*A-1
elif B>A:
    out=2*B-1
else:
    out=2*A

print(out)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split(" "))
lst = sorted([A, B, A-1, B-1], reverse=True)
print(sum(lst[:2]))

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

Submission status: Accepted

Solution code:
import numpy as np
words = lambda t : np.array(list(map(t, input().split())))
a,b = words(int)

m = max(a,b)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b =  map(int, input().split())
sum = 0
if(a>=b):
    sum += a
    a -= 1
else:
    sum += b
    b -= 1
if(a>=b):
    sum += a
    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:
a,b=map(int,input().split());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 = AB = list(map(int, input().split(" ")))

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

Submission status: Accepted

Solution code:
def main():
    A, B = [int(n) for n in input().split()]
    res = 0
    for _ in range(2):
        if A > B:
            res += A
            A -= 1
        else:
            res += B
            B -= 1
    print(res)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [A, B] = [int(input_raw[0]), int(input_raw[1])]
    s = 0
    if A >= B:
        s += A
        A -= 1
    else:
        s += B
        B -= 1
    s += max(A, B)
    print s


if __name__ == '__main__':
    main()

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
IA = lambda: [int(x) for x in input().split()]

A,B = IA()
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 = [int(i) for i in input().split()]

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

Submission status: Accepted

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

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())
x = 0
for _ in range(2):
    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().split()))
print(max(a,b) + max(max(a,b)-1,min(a,b)))

Submission status: Accepted

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

Submission status: Accepted

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

max_v = max(a,b)

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

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:
def int_raw():
    return int(input())


def ss_raw():
    return raw_input().split()


def ints_raw():
    return list(map(int, ss_raw()))


a, b = ints_raw()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if (A==B):
    print(A*2)

if (A>B):
    print(A+A-1)

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

Submission status: Accepted

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

result = 0

if A < B:
    result += B
    B -= 1
else:
    result += A
    A -= 1

if A < B:
    result += B
else:
    result += A

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

C = max(A, B)
if(C == A):
    A = A - 1
else:
    B = B - 1
D = max(A, B)
print(C + D)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
A, B = [int(item) for item in re.split(r"\s", input())]

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:
n,m=map(int,input().split())
i=0
if n>m:
  i+=n
  n-=1
else:
  i+=m
  m-=1
print(i+max(n,m))

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:
L=list(map(int,input().split()))
ans=[]
ans.append(max(L)+max(L)-1)
ans.append(sum(L))
print(max(ans))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if abs(A - B) > 1:
	print(max([A, B]) * 2 - 1)
else:
	print(min([A, B]) + max([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:
x,y = map(int,input().split())
if x == y:
    print(2*x)
else:
    s = max(x,y)
    print(s + (s-1))

Submission status: Accepted

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