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

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

main()

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,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 = list(map(int, input().split()))
a.append(a[0]-1)
a.append(a[1]-1)
a.sort()
print(a[-1]+ a[-2])

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

x=a+a-1
y=b+b-1
z=a+b
print(max(x,y,z))

Submission status: Accepted

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

coin = 0

for _ in range(2):
    if a > b:
        coin += a
        a -= 1
    elif a < b:
        coin += b
        b -= 1
    else:
        coin += a
        a -= 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())

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

total = 0

total += max(a, b)

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

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:
N = list(map(int,input().split()))
if(N[0]-N[1]>1):
	print(N[0]+N[0]-1)
elif(N[1]-N[0]>1):
	print(N[1]+N[1]-1)
else:
	print(N[0]+N[1])

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:
A, B = map(int, input().split())
num = max(A, B)
ans = num
num -= 1
ans += max(num, min(A, B))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

a, b = list(map(int, sys.stdin.buffer.readline().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,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:
A, B = map(int, input().split())
s = max(A, B)
if(A == B):
    s *= 2
else:
    s = 2*s-1
print(s)

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:
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())
lst=[A,A-1,B,B-1]
lst.sort()
print(lst[-1]+lst[-2])

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

ma = max(a, b)
mi = min(a, b)

print(ma + max(ma - 1, mi))

Submission status: Accepted

Solution code:
#124a
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())
if a!=b:
  print(max(a,b)+max(a,b)-1)
else:
  print(a+a)

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

res = 0
for _ in range(2):
    tmp = max(A,B)
    if A == tmp:
        A -= 1
    else:
        B -= 1
    res += tmp

print(res)

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

Submission status: Accepted

Solution code:
buttons = list(map(int, input().split()))
ans = 0
for i in range(2) :
	ans += max(buttons)
	buttons[buttons.index(max(buttons))] -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
lst = [a,b]
if a==b:
  print(2*a)
elif abs(a-b)>=1:
  print(2*max(lst)-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
(a, b) = map(int, input().split())
buttons = [a, b]
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())
Seq = [A,A-1,B,B-1]
Seq.sort()
print(sum(Seq[2:]))

Submission status: Accepted

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

if a == b:
  print(a+b)
  
else:
  print(c+(c-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:
a, b = map(int, input().split())

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

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:
# -*- coding: utf-8 -*-
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)+max((max(a,b)-1),min(a,b)))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = 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(" "))

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

Submission status: Accepted

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

x = max(a, b)
y = min(a, b)
z = max(x-1, y)

print(x + z)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l=[a+a-1,a+b,b+b-1]
print(max(l))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

ans=0
for _ in range(2):
    if i[0]>i[1]:
        ans += i[0]
        i[0] -= 1
    elif i[1]>=i[0]:
        ans += i[1]
        i[1] -= 1 
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import datetime

# 入力
#N = int(input())
#S = str(input())
#H, W = map(int, input().split())
A, B = map(int, input().split())

list = []
list.append(A)
list.append(B)
list.sort()

x = list[1]
list[1] -= 1
list.sort()
x += list[1]

print (x)

Submission status: Accepted

Solution code:
A,B=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    return


def main():
    A, B = map(int, input().split())
    print(max([A + B, A + A - 1, B + B - 1]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def print_ans(A, B):
    """Test Case
    >>> print_ans(5, 3)
    9
    >>> print_ans(3, 4)
    7
    >>> print_ans(6, 6)
    12
    """
    ans = sorted([A, B, A - 1, B - 1])
    print(ans[-1] + ans[-2])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

OnlyA = A+(A-1)

OnlyB = B+(B-1)

AaddB = A + B

print(max([OnlyA,OnlyB,AaddB]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split(' '))
ans=0
def button(A,B,ans):
  if A>B:
    ans+=A
    A-=1
  else:
    ans+=B
    B-=1
  return A,B,ans

A,B,ans=button(A,B,ans)
A,B,ans=button(A,B,ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if lar-sma >= 2:
    print(lar*2-1)
else:
    print(lar+sma)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

data.sort()

if data[1] - data[0] >=1:
    ans = data[1]*2 - 1
elif data[1] == data[0]:
    ans = data[1]*2
else:
    ans = sum(data) - 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())
if a == b:
    print(2*a)
else:
    print(max(a, b)*2-1)

Submission status: Accepted

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

Submission status: Accepted

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

# AA AB BB
max = max(data[0]+data[0]-1, data[0]+data[1], data[1]+data[1]-1)

print(max)

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
num1 = max(a, b)
num2 = min(a, b)
ans = num1

if num1-1 > num2:
  ans += num1-1
else:
  ans += num2
  
print(ans)

Submission status: Accepted

Solution code:
# 2019-11-13 01:34:25(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    a, b = [int(x) for x in sys.stdin.readline().split()]
    if a == b:
        ans = a + b
    elif a > b:
        ans = a + (a - 1)
    elif b > a:
        ans = b + (b - 1)
    
    print(ans)



if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

after_1p = max(a, b) - 1
# after_2p = max(min(a, b), after_1p) - 1

ans = max(a, b) + max(min(a, b), after_1p)

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

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
lower, greater = sorted([a, b])

if greater-lower >= 2:
    print(greater+(greater-1))
else:
    print(greater+lower)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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(2*a-1,a+b,2*b-1))

Submission status: Accepted

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

if a<b:
  a,b=b,a

ret = a+max([a-1,b])

print(ret)

Submission status: Accepted

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

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()) 
ans = 0
if a >= b+1:
    ans = 2*a-1
elif b >= a+1:
    ans = 2*b-1
elif a == b:
    ans = a
    if a-1 < b:
        ans += b
    else:
        ans += a
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())

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) * 2 - 1 if A != B else max(A, B) * 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:
# ABC 124: A – Buttons
a, b = [int(s) for s in 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+A-1,B+B-1,A+B))

Submission status: Accepted

Solution code:
c = list(map(int, input().split()))
c.sort()
ans = c.pop()
c.append(ans-1)
c.sort()
ans += c.pop()
print(ans)

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 = list(map(int, input().split()))
a.sort()
print(max(a[0], a[1])+max(a[0], a[1]-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:
def chooseBig(x, y):
    if x > y:
        return x, x - 1, y
    else:
        return y, x, y - 1

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

sum1, A, B = chooseBig(A, B)
sum2, A, B = chooseBig(A, B)
print(sum1 + sum2)

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

Submission status: Accepted

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

m1 = max(ab)
ab[ab.index(m1)] = m1 - 1
m2 = max(ab)

print(m1 + m2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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());
ans = 0;
if a > b:
    ans = a + (a-1);
elif a < b:
    ans = b + (b-1);
elif a == b:
    ans = a + b;
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:
from sys import stdin
import bisect

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

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

print(point)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

lists = sorted([a, a-1, b, b-1])
print(lists[2] + lists[3])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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


if __name__ == '__main__':
    main()