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: Wrong Answer

Solution code:
A, B = map(int,input().split())
def ma(A, B):
    x = max(A, B)
    ans = 2 * x - 1
    return ans
print(ma(A, B))

Submission status: Wrong Answer

Solution code:
s = list(input())

count = 0

for i in range(1, len(s)):
    if s[i] == s[i-1]:
        count += 1

        if s[i] == '1':
            s[i] = '0'
        else:
            s[i] = '1'

print(count)

Submission status: Wrong Answer

Solution code:
s = list(input())

count = 0

for i in range(1, len(s)):
    if s[i-1] == s[i]:
        count += 1

        if s[i] == '1':
            s[i] = '0'
        else:
            s[i] = '1'

print(count)

Submission status: Wrong Answer

Solution code:
s = list(input())

count = 0

for i in range(1, len(s)):
    if s[i-1] == s[i]:
        count += 1

        if s[i-1] == '1':
            s[i] = '0'
        else:
            s[i] = '1'

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split()
b = 0
for i in range(len(a)):
    a.sort(reverse=True)
    b = b + int(a[0])
    if int(a[0]) <= 0:
        continue
    else:
        a[0] = str(int(a[0]) - 1)
print(b)

Submission status: Wrong Answer

Solution code:
a = input().split()
b = 0
for i in range(len(a)):
    a.sort(reverse=True)
    b = b + int(a[0])
    a[0] = str(int(a[0]) - 1)
print(b)

Submission status: Wrong Answer

Solution code:
a = input().split()
b = 0
for i in range(2):
    sorted(a)
    b = b + int(a[0])
    a[0] = str(int(a[0]) - 1)
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
count=0
for v in range(2):
    if a[0]>=a[1]:
        count+=a[0]
    else:
        count+=a[1]
print(count)

Submission status: Wrong Answer

Solution code:
A = 5
B = 7
if A > B:
    print(2 * A - 1)
elif A < B:
    print(2 * B - 1)
else:
    print(2 * A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

high=0
low=0
if a==b:
    high=a
    low=b
elif a>b:
    high=a
else:
    low=b

temp=a+b
temp2=high+(high-1)

if temp>temp2:
    print(temp)
else:
    print(temp2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a < b-1:
    second_choice = b-1
elif b < a-1:
    second_choice = a-1
else:
    second_choice = a

print(first_choice + second_choice)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
s=input()
print(min(s[::2].count("1")+s[1::2].count("0"),s[::2].count("0")+s[1::2].count("1")))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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 -= B
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = [int(n) for n in input().split()]
ans = 0
for i in range(2):
  ans += A if A >= B else B
print(ans)

Submission status: Wrong Answer

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

import sys
sys.setrecursionlimit(10**8)

def operation(s,memo=-1,ans=0):
    if len(s) <= 0:
        return ans
    elif s[0] == memo == "0": #変えるパターン
        return operation(s[1:],"1",ans+1)
    elif s[0] == memo == "1": #変えるパターン
        return operation(s[1:],"0",ans+1)
    else:
        return operation(s[1:],s[0],ans)

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

# x = sorted([a, b, a - 1, b - 1], reverse=True)
# print(x[0] + x[1])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    num_list = list(map(int, input().split()))

    sorted(num_list, reverse=True)

    if num_list[0] -1 >= num_list[1]:
        ans = num_list[0] + num_list[0] -1
    else:
        ans = num_list[0] + num_list[1]

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
N = len(S)

count = 0
for i in range(N-1):
  if S[i] == S[i+1]:
    if S[i] == "0":
      S[i+1] = '1'
    if S[i] == "1":
      S[i+1] = '0'
    count += 1
      
print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
print(n*(n-1) if n >= m else m*(m-1))

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = 2
total = 0
while n > 0:
  if a > b:
    total=total+a
  else:
    total=total+b
  n-=1
print(total)

Submission status: Wrong Answer

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

aa = a+a-1
bb = b+b-1
ab = a+b-1

lists = [aa,bb,ab]
print(max(lists))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def ll():
    return list(map(int,input().split()))
s = ll()
if 2*s[0]-1>s[0]+s[1]:
    print(2*s[0]-1)
else:print(s[0]+s[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s=max(a,b)

print(s*(s-1))

Submission status: Wrong Answer

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

if(abs(A-B) == 2):
    res = max(A,B)+(max(A,B)-1)
else:
    res = A+B

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

soma0= a + b

soma1 = a 
a = a-1
soma1 = soma1 + a 
a = a-1 

soma2 = b
b = a-1
soma2 = soma2 + b
b = b-1

if soma0>=soma1 and soma0>=soma2:
    print(soma0)

elif soma1>=soma0 and soma1>=soma2:
    print(soma1)

else:
    print(soma2)

Submission status: Wrong Answer

Solution code:

A, B = [int(i) for i in input().split(' ')]
     
def f():
    res = 0
    if A > B and A - 1 > B:
        res += A + A - 1
    elif B > A and B - 1 > A:
        res += B + B - 1
    else:
        res = A + B
    return res
f()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

total =0

for i in range(2):
    if a >= b:
        total+=a
    else:
        total+=b

print(total)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

A, B = mi()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a-1 > b:
    ans += a-1
elif a < b-1:
    ans += b-1
else: ans += a

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
p,q= input().split()
(a,b) =(int(p), int(q))
size_bottum = [a,b]
total = 0
total +=max(size_bottum)
total +=max(size_bottum) -1
print(total)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x == y:
  ans = x * 2
if x > y:
  ans = 2*x - 1
else:
  ans = 2*y - 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
print(max(max(x,y)*2-1,x*2))

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if x!=y:
  print(max(x,y)*2)
else:
  print(x*2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
odd = S[1::2]
even = S[::2]
print(min(odd.count("1") + even.count("0"), even.count("1") + odd.count("0")))

Submission status: Wrong Answer

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

    ans = 0

    if a == b:
        ans = a * 2
    else:
        ans = a * 2 - 1

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def main1(A, B):
    res = 0
    if B + 1 < A:
        res = (A * 2) - 1
    elif A == B :
        res = A + B
    else:
        res = (B * 2) - 1
    print(res)

main1(A, B)

Submission status: Wrong Answer

Solution code:
A=sorted(map(int,input().split()))
print( A[1]*2-1 if A[1]+A[0]-1 <= A[1]*2-1 else A[1]+A[0]-1 )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def max_coins(a, b):
  if a > b:
    print(a + (a -1))
  elif a == b:
    print(a + b)
  else:
    print(b + (b-1))

Submission status: Wrong Answer

Solution code:
def main():
  if 'get_ipython' not in globals():  
    a,b = map(int,input().split())
  else:
    a,b = 3,11
    s = "test"
 
  def get(a,b, count, ans):
    if count == 0:
      return(ans)
    
    if a >= b:
      print(a, b, ans)
      return(get(a-1, b, count -1, ans + a))
    else:
      return(get(a, b-1, count -1, ans + b))
  
  print(get(a, b, 2, 0))
  
main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(c+(c-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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)
    
    print (2*max - 1)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC 124: A – Buttons
a, b = [int(s) for s in input().split()]
print(max(a + a - 1, a + b))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(answer)

Submission status: Wrong Answer

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

lista=[]

lista.append(b)
lista.append(b-1)
lista.append(a)
lista.append(a-1)

lista.sort()
print(lista)
print(lista[-1]+lista[-2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l = sorted([a,b,a-1,a-2],reverse = True)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

a,b=x[0],x[1]

y = (max(a,b))

print((y*2)-1)

Submission status: Wrong Answer

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

lst = [a,a-1,b,b-2]
lst = sorted(lst, reverse=True)
print(lst[0]+lst[1])

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if b < 4:
  print(2*a)
else:
  print(2*b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(max(list(map(int, input().split()))) * 2 - 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

r1 = max(a,b)

if r1 == 1:
  a -= 1
else:
  b -= 1
r2 = max(a,b)

print(r1+r2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
numbers = [int(i) for i in input().split()]

num1 = numbers[0]
num2 = numbers[1]

sum = 0
for i in range (2):
    
    if num1 >=num2:
        sum += num1
        num1 = num1 -1
    else:
        sum += num2
        num2 = num1-1

print (sum)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = str(raw_input())
n = len(S)

pattern0 = ("10" * (n//2 + 1))
pattern1 = ("01" * (n//2 + 1))
count0 = 0
count1 = 0

for i in range(n):
    if pattern0[i] != S[i]:
        count0 += 1
    if pattern1[i] != S[i]:
        count1 += 1

print min(count0, count1)

Submission status: Wrong Answer

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

ans = 0
ans += max(a,b)
if a >= b:
	a -= 1
if a < b:
	b -= 1

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(0,2):
    print(i)
    if A >= B:
        C += A
        A -= 1
    elif A < B:
        C += B
        B -= 1
print(C)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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