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 python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

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

Submission status: Accepted

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

result = max(A+(A-1),A+B,B+(B-1))

print(result)

Submission status: Accepted

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

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

res = max([A+B,A+A-1,B+B-1])

print(res)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    A, B = map(int, input().split())

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


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans=max(a+a-1,
        a+b,
        b+b-1)

print(ans)

Submission status: Accepted

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

a_min = a-1
b_min = b-1
print(max(a+b,a+a_min,b+b_min))

Submission status: Accepted

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

Submission status: Accepted

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

x = []

x.append(a + a-1)
x.append(b + b-1)
x.append(a + b)
print(max(x))

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A,B=MAP()

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

Submission status: Accepted

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

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:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [tuple(map(int, l.split())) for l in sys.stdin]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)

def main():
    a = sorted(LI())
    r = a[-1]
    a[-1] -= 1

    return r + max(a)


print(main())

Submission status: Accepted

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

ans += max(a, b)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())

a,b = map(int, raw_input().split())
print max(a+b, 2*a-1, 2*b-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A問題
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(2*A-1)
elif A==B:
    print(2*A)
else:
    print(2*B-1)

Submission status: Accepted

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

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

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 = (int(i) for i in input().split())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))

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

Submission status: Accepted

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

c = max(a,b)

if c==a:
    a-=1
else:
    b-=1
    
d = max(a,b)

print(c + d)

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yay!")
    else:print(":(")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
#n = ip()                                     #入力整数1つ
#a,b= (int(i) for i in input().split())       #入力整数横2つ以上
a = [int(i) for i in input().split()]        #入力整数配列
#c = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
a.sort()
s = a[1]
a[1]-=1
print(s+max(a))

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
from collections import deque, defaultdict as ddic
from itertools import combinations, permutations, product
import bisect
import heapq

rs = lambda: stdin.readline().strip()
ri = lambda: int(rs())
rsl = lambda: stdin.readline().split()
rim = lambda: map(int, rsl())
ril = lambda: list(rim())

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


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())
C = max(A+A-1,B+B-1,A+B)
print(C)

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B = MAP()

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

Submission status: Accepted

Solution code:

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

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

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+a-1,a+b,b+b-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())
print( max( a + b , a + a - 1 , 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:
A, B = 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 = max(2*a-1,2*b-1,a+b)
print(ans)

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


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

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


print(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:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

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

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

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:
def Y(flag):
    if flag:
        print('YES')
    else:
        print('NO')

def y(flag):
    if flag:
        print('Yes')
    else:
        print('No')

a,b = map(int,input().split())
l = [a,b,a-1,b-1]
l = sorted(l)
print(l[-1] + l[-2])

Submission status: Accepted

Solution code:
#

import itertools
from collections import Counter
import bisect

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:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime,random
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

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

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
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b = LI()
    if a == b:
        print(2*a)
    else:
        print(2*max(a,b)-1)
    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

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

Submission status: Runtime Error

Solution code:
s = 0
for i in range(2):
    if A > B:
        s += A
        A -= 1
    elif B > A:
        s += B
        B -= 1
    elif A == B:
        s += A
        A -= 1
print(s)

Submission status: Runtime Error

Solution code:
s = 0
for i in range(2):
    if A > B:
        s += A
        A -= 1
    else:
        s += B
        B -= 1
print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
m=input()
m=m.split(" ")
a=m[0]
b=m[1]

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

Submission status: Runtime Error

Solution code:
a,b=input().split()
M=max(a,b)
m=min(a,b)

n=0
n+=M
M-=1

n+=max(M,m)

print(n)

Submission status: Runtime Error

Solution code:
a=int(input())
s=input()
if a>=3200:
   print(s)
if a<3200:
   print("red")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=list(int(input()))
if n[0]==n[1]:
    print(n[0]*2)
else:
    print(max(n)*2-1)

Submission status: Runtime Error

Solution code:
n,a,b,=map(int,input().split())
if a*n>b:
    print(b)
if a*n<b:
    print(a*n)
if a*n==b:
    print(a*n)

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
point = 0
point += max(a,b)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
A, B = map(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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:

A=int(input("ボタンA"))
B=int(input("ボタンB"))
get1=A
m=A-1
get2=B
m=B-1
sum=get1+get2
print("合計の最大値は{}です".format(sum))

Submission status: Runtime Error

Solution code:
A=int(input("ボタンA"))
B=int(input("ボタンB"))
get1=A
m=A-1
get2=B
minus=B-1
sum=get1+get2
print("合計の最大値は{}です".format(sum))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input())
c=[a,b,a-1,b-1];c.sort()
print(sum(c[-2:]))

Submission status: Runtime Error

Solution code:
a, b = [int(x) for x in input()]
print(max(a + a - 1, a + b, b + b - 1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0

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

Submission status: Runtime Error

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 _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

N, K = mi()
S = input()

len_list = [0]*(10**5)
ind = 0
if S[0] == '0':
    len_list[0] = 0
    ind += 1

cnt = 1
for i in range(1, N):
    if S[i] != S[i-1]:
        len_list[ind] = cnt
        ind += 1
        cnt = 1
    else:
        cnt += 1
len_list[ind] = cnt

#print(len_list[:30])
i = 0
wa = 0
while True:
    if len_list[i+2*K+1] != 0:
        wa = max(wa, sum(len_list[i:i+2*K+1]))
    else:
        wa = max(wa, sum(len_list[i:]))
        break
    i += 2
print(wa)

Submission status: Runtime Error

Solution code:
S = input()
S1 = ''
S2 = ''
if i in range(len(S)):
    if i % 2 ==0 :
        S1 += '0'
        S2 += '1'
    else :
        S1 += '1'
        S2 += '0'
min1 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min1 += 1
min2 = 0
for i in range(len(S)):
    if S[i] != S1[i]:
        min2 += 1 
print(min(min1,min2))

Submission status: Runtime Error

Solution code:
N = int(input())
H = list(map(int,input().split()))
maxi = 0
cnt = 0
for i in range( N ) :
    if H[i] >= maxi :
        cnt += 1
        maxi = H[i]
print( cnt )

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
aa

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
  x = A + B

print(x)

Submission status: Runtime Error

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
  x = A + B

print(x)

Submission status: Runtime Error

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
 S = A + B

print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(sum(Number))
else:
    print(f'{Number[1]*2 -1}')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = [int(i) for i 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: Runtime Error

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: Runtime Error

Solution code:
n,m=map(int,input().split())

if n>m:
  print(n+n-1)
  
elif n<b:
  print(m+m-1)

  else:
  print(n+m)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
intmain() {intA, B; cin  >> A >> B;intans;if(A > B) {ans = A + (A-1);}elseif(B > A) {ans = B + (B-1);}else{ans = A + B;}cout  << ans  << endl;}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
Number= list(map(int, input().split()))
Number.sort()
if Number[0] == Number[1]:
    print(Number.sum())
else:
    print(f'{Number[1]*2 -1}')

Submission status: Runtime Error

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

scoew = 0
if A >= B:
	score = score + A
    A = A -1
else:
	score = score + B
    B = B -1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(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: Runtime Error

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

Submission status: Runtime Error

Solution code:
import rebound
import numpy as np
import random
A = random.randrange(1,3)
B = random.randrange(1,20)
print (A,B)

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

Submission status: Runtime Error

Solution code:
A >=3, B <=20
for A,B 
   A-1 or B-1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


for i in range(2):
  
  d+=max(c)
  max(c)=d-1
print(d)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = int(input())
h = [2*A-1, 2*B-1, A+B]
maxvalue = 0
for i in range(len(h)):
    if h[i] >= maxvalue:
        maxvalue = h[i]
print(maxvalue)