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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(x + y)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


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

l = [a,a-1,b,b-1]
l = sorted(l,key=lambda x:-x)
print(sum(l[0:2]))

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:
import numpy as np
from collections import defaultdict
from collections import Counter
from collections import OrderedDict
#key = {1:2, 2:5, 3:5, 4:4, 5:5, 6:6, 7:3, 8:7, 9:6}
# A = int(input())
A, B = (int(i) for i in input().split())
sum1 = 0
if A < B:
    sum1 += B
    B -= 1
else:
    sum1 += A
    A -= 1
if A < B:
    sum1 += B
    B -= 1
else:
    sum1 += A
    A -= 1
print(sum1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inn = input()
inn = inn.split()

a = int(inn[0])
b = int(inn[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import numpy as np
from functools import lru_cache
import time

def main(): 
    if True:
        H,W = list(map(int, input().split()))
    else:
        pass

    if H == W :
        print(H+W)
    else :
        print(max(H,W)*2-1)
if __name__ =='__main__':
    main()

Submission status: Accepted

Solution code:
a, b = [int(i) for i in 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)
else:
    n=max(a,b)
    print(n*2-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
A1=2*A-1
B1=2*B-1
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(2*A-1,2*B-1,A+B))

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

Submission status: Accepted

Solution code:

def kakaka():
    a = list(map(int, input().split()))
    b = map(int, input().split())
    c = int(input())

def start_process():
    return
def main():
    a, b = map(int, input().split())
    if a > b:
        count = a
        a -= 1
    else:
        count = b
        b -= 1
    count += max(a, b)
    print(count)



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())
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:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print(max(max(A+B,2*A-1),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())
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:
A,B=[int(x) for x in 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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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

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

  print(max(x, y, z))


if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

Submission status: Accepted

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

ans += max(a,b)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a, b = (int(_) for _ in input().split())
    a_1 = a-1
    b_1 = b-1
    ans = max(a+a-1,b+b-1,a+b)
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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)

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:
from sys import exit
A,B = [int(n) for n in input().split()]
# N = int(input())
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()

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

Submission status: Accepted

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 -= 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
#s = input()
res = 0
res += max(a,b)
a,b = max(a,b)-1,min(a,b)
res += max(a,b)
print(res)

Submission status: Accepted

Solution code:
A , B = map(int,input().split())
ans = 0
if A == B:
    print(A+B)
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 = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

coin = 0

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

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

print(coin)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

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:
a,b=[int(i) for i in input().split()]
Max=max(a,b)
Min=min(a,b)
print(Max+max(Max-1,Min))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def buttons(A: int, B: int)->int:
    s = 0
    for _ in range(2):
        if A > B:
            s += A
            A -= 1
        else:
            s += B
            B -= 1
    return s


if __name__ == "__main__":
    A, B = map(int, input().split())
    ans = buttons(A, B)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(I) for I in input().split()]
r = 0
if a > b:
    r += a
    a -= 1
else:
    r += b
    b -= 1

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

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

# input = sys.stdin.readline

# N個整数
a, b = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
# b = list(map(int, input().split()))

# 空白区切り文字列
# t, d = input().split()
ret = 0
if a > b:
    ret += a
    a -= 1
else:
    ret += b
    b -= 1
ret += max(a, b)
print(ret)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    input = sys.stdin.readline
    try:
        a,b = map(int,input().split())
        cnt = 0
        if a > b:
            cnt += a
            a -= 1
        else:
            cnt += b
            b -= 1
        if a > b:
            cnt += a
            a -= 1
        else:
            cnt += b
            b -= 1
        
        print(cnt)
        
    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

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

a1 = max(x, y)
if a1 == x:
    x -= 1
else :
    y -= 1

a2 = max(x,y)

print(a1+a2)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b = LI()
    if a < b:
        a, b = b, a
    ans = a
    a -= 1
    ans += max(a, b)
    print(ans)
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

Solution code:
A, B = [int(i) for i in input().split()]
c, d = sorted((A, B))
ans = d
d -= 1
e, f = sorted((c, d))
ans += f
print(ans)

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:

a,b = map(int,input().split())
#s = [a for a in input()]

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 20:56:16 2019

@author: Yamazaki Kenichi
"""

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

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

Submission status: Accepted

Solution code:
#coding:utf-8
A,B=map(int, raw_input().split())
ans=0
if A<B:
    ans+=B
    B-=1
else:
    ans+=A
    A-=1
if A<B:
    ans+=B
    B-=1
else:
    ans+=A
    A-=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input().split()
A = int(data[0])
B = int(data[1])
ans = 0
if A < B:
    ans += B
    B -= 1
else:
    ans += A
    A -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template #


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B = IL()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect
from collections import deque
from collections import defaultdict
from fractions import gcd
#from math import factorial
from math import sqrt
from math import ceil
from itertools import permutations
from heapq import *

#N=int(input())
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())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

a,b = nm()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(A: int, B: int):

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


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

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

ma = [a+a-1,b+b-1,a+b]

print(max(ma))

Submission status: Accepted

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


def solve(A: int, B: int):
    if A == B:
        ret = A + B
    else:
        ret = max(A, B) * 2 - 1
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Submission status: Accepted

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