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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#coding:UTF-8

# ２つのボタンのコイン獲得枚数を取得
buttons = list(map(int, input().split()))

# 最大獲得コイン取得用領域
max_coin = 0

for _ in range(2):
  if buttons[0] > buttons[1]:
    max_coin += buttons[0]
    button[0] -= 1
  else:
    max_coin += button[1]
    buttons[1] -= 1
    
# 結果出力
print(max_coin)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
ans = 0

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

print(ans)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
S = list(input())

if len(S) == 1:
    print(1)
elif len(S) == 2:
    print(2)
elif S[0] == '0':
    LA = [0]
    LB = [0]
    for i in range(1,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    ANS = 0
    if K >= len(LB)-1:
        print(N)
    else:
        for i in range(len(LA)-K):
            J = LB[i+K]-LB[i]+1
            if J > ANS:
                ANS = J
        print(ANS)
else:
    LA = [0]
    LB = []
    for i in range(0,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    ANS = 0
    if K >= len(LB)-1:
        print(N)
    else:
        for i in range(len(LB)-K):
            J = LB[i+K]-LA[i]+1
            if J > ANS:
                ANS = J
        print(ANS)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
S = list(input())

if len(S) == 1:
    print(1)
elif len(S) == 2:
    print(2)
elif S[0] == '0':
    LA = [0]
    LB = [0]
    for i in range(1,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    print(LA)
    print(LB)
    ANS = 0
    if K > len(LB)-1:
        print(len(S))
    else:
        for i in range(len(LA)-K):
            J = LB[i+K]-LB[i]+1
            if J > ANS:
                ANS = J
        print(ANS)
else:
    LA = [0]
    LB = []
    for i in range(0,N-1):
        if (S[i] != S[i+1]) & (S[i] == '0'):
            LA.append(i+1)
        elif (S[i] != S[i+1]) & (S[i] == '1'):
            LB.append(i)
    LB.append(N-1)
    print(LA)
    print(LB)
    ANS = 0
    if K > len(LB)-1:
        print(len(S))
    else:
        for i in range(len(LB)-K):
            J = LB[i+K]-LA[i]+1
            if J > ANS:
                ANS = J
        print(ANS)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#ABC124C/Coloring_Colorfully_
def main():
    s = [int(x) for x in input()]
    odd = s[::2]
    even = s[1::2]
    cnt = 0

    if odd[0]:
        cnt = odd.count(0) + even.count(1)    
    else:
        cnt = odd.count(1) + even.count(0)
    print(cnt)
main()

Submission status: Runtime Error

Solution code:
#ABC124C/Coloring_Colorfully_別解
def main():
    s = [int(x) for x in input()]
    odd = s[::2]
    even = s[1::2]
    cnt = 0

    if odd[0]:
        cnt = odd.count(0) + even.count(1)    
    else:
        cnt = odd.count(1) + even.count(0)
    print(cnt)
main()

Submission status: Runtime Error

Solution code:
A=raw_input('A:')
B=raw_input('B:')

C=int(A)+int(B)
D=int(A)+int(A)-1
E=int(B)+int(B)-1

print(max[C,D,E])

Submission status: Runtime Error

Solution code:
N , K = map(int,input().split())
S = str(input())
T =[] #０と１の個数を並べていったリスト
m = 1
for i in range(N-1):
    if S[i] == S[i + 1]:
        m = m + 1
    else:
        T.append(m)
        m = 1
T.append(m)
n = len(T)

left_1 = []
left_0 = []
if S[0] == str(1):
    if K >= (len(T) // 2):
        ans = N
    else:
        if len(T) % 2 == 0:
            i = 0
            while 2*i + 2*K + 1 <= n:
                left_1.append(sum(T[2*i:2*i+2*K+2]))
            left_1.append(sum(T[n - 2*K :n]))
            ans = max(left_1)
        else:
            i = 0
            while 2*i + 2*K + 1 <= n:
                left_1.append(sum(T[2*i:2*i+2*K+2]))
            ans = max(left_1)

else: # if S[0] == 0:
    if n % 2 == 0: 
        if K >= (len(T) / 2):
            ans = N
        else:
            left_0.append(sum(T[0:2*K]))
            i = 0
            while 2*i + 2*K + 2 <= n:
                left_1.append(sum(T[2*i + 1:2*i + 2*K + 3]))
            ans = max(left_0)
    
    else:
        if K >= (len(T)//2 + 1):
            ans = N
        else:
            left_0.append(sum(T[0:2*K]))
            left_0.append(sum(T[n-2*K:n]))
            while 2*i + 2*K + 2 <= n:
                left_1.append(sum(T[2*i + 1:2*i + 2*K + 3]))
            ans = max(left_0)

print (ans)

Submission status: Runtime Error

Solution code:
nums = map(int, raw_input())
a = max(nums)
b = min(nums)
ans = a + max(a - 1, b)
print ans

Submission status: Runtime Error

Solution code:
nums = map(int, raw_input().split(""))
print sum(nums)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
print(max([a*a,b*b,a*b]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input.split(' ')
A = a[0]
B = a[1]
A_A = A + A - 1
A_B = A + B
B_B = B + B - 1
list = [A_B, A_A, B_B]
list.sort(reverse=True)
print(list[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

m = a[0]
k = b[0]
for i in range(n):
    if a[i] >b[i] :
        ans += a[i]-b[i]
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
a=int(input())
b=int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
m = 0
c = 0
for i in A:
    if m <= i:
        c += 1
        m = i
 
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int, input().split()))
sum = 0
m = 0
for i in h:
    if m <= i:
        sum += 1
        m = i
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int, input().split()))
sum = 0
max = 0
for i in h:
    if max <= i:
        sum += 1
        max = i
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int, input().split()))
sum = 0
max = 0
for i in range(n):
    if max <= h[i]:
        sum += 1
        max = h[i]
print(sum)

Submission status: Runtime Error

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

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

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

Solution code:
A=int(input())
B=int(input())
if A>B:
  print("2A-1")
if A<B:
  print("2B-1")
if A==B:
  print("A+B")

Submission status: Runtime Error

Solution code:
if A>B:
  print("2A-1")
if A<B:
  print("2B-1")
if A==B:
  print("A+B")

Submission status: Runtime Error

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

s_1 = sorted(s)

s_2 = sorted([s_1[0], s_1[1]-1])

A = s_1[1] + s_2[1]

print(A)

Submission status: Runtime Error

Solution code:
s=list(map(int,list(input())))
so=[]
se=[]
for i in range(len(s)):
    if i%2==0:
        so.append(s[i])
    if i%2!=0:
        se.append(s[i])

tso=sum(so)
tse=sum(se)

if tso>tse:
    print(-(-len(s)//2)-tso+tse)

else:
    print(len(s)//2+tso-tse)

Submission status: Runtime Error

Solution code:
def possible(m):
    l = 0
    r = 1
    zeroes = 0
    ans = N
    while r != N:
        if r - l > m:
            ans = min(ans, zeroes)                   
            l += 1
            if s[l] != s[l - 1] and s[l] == '1':
                zeroes -= 1
        if s[r] != s[r - 1] and s[r] == '0':
            zeroes += 1
        r += 1
    return min(zeroes, ans) <= K
            
N, K = map(int, input().split())
s = input()
l = 0
r = N + 1
while r - l > 1:
    m = (l + r) // 2
    if possible(m):
        l = m
    else:
        r = m
print(l)

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
S=input()

l=[0]
curr='1'

for c in S:
    if c !=curr:
        l.append(1)
        curr=c
    else:
        l[-1]+=1
if curr=='0':
    l.append(0)

n_group=len(1)
sum_=0
k =min(k,n_group)

for i in range(k):
    sum_+=l[2*i]+l[2*i+1]
sum_ +=l[2*k]
max_=sum_

for i in range(k,n_group):
    sum_ -=l[2*i-2*k]+l[2*i+1-2*k]
    sum_ +=l[2*i+1]+l[2*i+2]
    max_ =max(max_,sum_)

print(max_)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input_val = []
for i in range(6) :
    input_val.append(int(input()))

input_size = len(input_val)
count = 0
for i in range(5) :
    stan_val = input_val[i]
    for j in range(i+1,5) :
        diff = abs(stan_val - input_val[j])
        if diff > input_val[5] :
            count += 1
            
        else : count = count

if count == 0 :
   print("Yay!")
else : print(":(")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

while tmp<3:
  if A > B:
    cnt+=A
    A-=1
  elif A < B:
    cnt+=B
    B-=1
  else:
    cnt+=A
   A-=1
print(cnt)

Submission status: Runtime Error

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

while tmp<3:
  if A > B:
    cnt+=A
    A-=1
  elif A < B:
    cnt+=B
    B-=1
  else:
    cnt+=A
   A-=1
print(cnt)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:

def main():
    A = int(input())
    B = int(input())

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

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

    print(ans)

    return

if __name__ == '__main__' :
    main()

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
S=input()
First=S[0]
Now=First
cnt=0
A=[0]
for s in S:
    if Now=='1' and s=='0':
        A+=[cnt]
        Now='0'
    elif Now=='0' and s=='1':
        A+=[cnt]
        Now='1'
    cnt+=1
A+=[N]
dp=2*K+1
ans=[]

if First=="0":
    p=1
    ans.append(A[min(dp-1,len(A)-1)])
else:
    p=0
    ans.append(A[min(dp,len(A)-1)])

while p+dp<len(A):
	ans.append(A[p+dp]-A[p])
	p+=2

print(A)
print(max(ans))

Submission status: Runtime Error

Solution code:
A,B=input()
coin=0
for i in range(0,2):
    pre=max(A,B)
    coin+=pre
    if(pre==A):
        A-=1
    else:
        B-=1

Submission status: Runtime Error

Solution code:
A,B=input()
coin=0
for i in range(0,2):
    pre=max(A,B)
    coin+=pre
    if(pre==A):
        A-=1
    else:
        b-=1

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
S=input()
First=S[0]
Last=S[N-1]

Now=First
cnt=0
A=[0,0]
for s in S:
    if Now=='1' and s=='0':
        A+=[cnt]
        Now='0'
    elif Now=='0' and s=='1':
        A+=[cnt]
        Now='1'
    cnt+=1
A+=[cnt,cnt]

ans=0
dp=2*K+1
if First=="0":
    p=0
else:
    p=1
while p+dp<len(A):
   if A[p+dp]-A[p]>ans:ans=A[p+dp]-A[p]
   p+=2
print(ans)

Submission status: Runtime Error

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

ans = 1 
for i in range(1,N):
    if H[i] >= max(H[:i]):
        ans += 1
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,k = list(map(int, input().split()))
s = input()
if s[n-1] == '1':
	s += '0'
else:
	s += '1'
c = []

j = 0
for i in range(1, n+1):
	if s[i-1] == s[i]:
		j += 1
	else:
		c.append([s[i-1], j+1])
		j = 0

for i in range(1, len(c)):
	c[i][1] += c[i-1][1]

if 2*k >= 2*len(c):
	print(c[-1][1])
	quit()
else:
	p = 0
	res = 0
	if s[0][0] == '0':
		res = c[1][1] if k == 1 else c[2*k+1][1]
		p += 1
	else:
		res = c[2][1] if k == 1 else c[2*k][1]
		p += 2

	while p+2*k < len(c):
		res = max(res, c[p+2*k][1] - c[p-1][1])
		p += 2

	print(res)
	quit()

Submission status: Runtime Error

Solution code:
m=int(input())
a=list(map(int,input().split()))
D=1
n=1

while n < m:
 if a[n] < max(a[0:n]):
  D=D 
  n=n+1
 else:
  D=D+1 
  n=n+1

print(D)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

Solution code:
import numpy as np
x=list(map(int,input().split()))
x=np.array(x)
ma=max(x)
mi=min(x)
b=ma-mi
if b>=2:
    out=ma+ma-1
else:
    out=ma+mi
print(out)

Submission status: Runtime Error

Solution code:
x=list(map(int,input().split()))
x=np.array(x)
ma=max(x)
mi=min(x)
b=ma-mi
if b>=2:
    out=ma+ma-1
else:
    out=ma+mi
print(out)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
sum=0
if a >= b:
    sum += a
    a -= 1
    if a >= b:
        sum += a
    else:
        sum += b
else:
    sum += b
    if a < b:
        sum += b
    else:
        sum +=a
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import gcd
a,b=map(int,input().split())
print(gcd(a,b))

Submission status: Runtime Error

Solution code:
from math import gcd,ceil
a,b=map(int,input().split())
print(gcd(a,b))

Submission status: Runtime Error

Solution code:
from math import gcd,ceil
a,b=map(int,input().split())
print(gcd(a,b))

Submission status: Runtime Error

Solution code:
a,b,t = map(int, input().split())
ans=0
for i in range(1,t):
    if i%a ==0:
        ans = ans + b

print(ans)

Submission status: Runtime Error

Solution code:
AA = A + (A - 1)
AB = A + B
BB = B + (B - 1)

print(max(AA, AB, BB))

Submission status: Runtime Error

Solution code:
sum = [0 for i in range(3)]
sum[0] = A + (A - 1)
sum[1] = A + B
sum[2] = B + (B - 1)
print(max(sum))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
k = int(input().split(" ")[1])
s = input()

arr = []
if s[0] is "0": 
  arr.append(0)
arr.append(1)
for i in range(1,len(s)):
  if s[i-1] is s[i]:
    arr[-1] += 1
  else:
    arr.append(1)
if s[-1] is "0": 
  arr.append(0)

t = 2*k+1
if t>len(s):
  print(len(s))
else:
  temp = sum(arr[0:t])
  m = temp
  for i in range(2,len(arr)-t+1,2):
    m = max(m,temp-arr[i-2]-arr[i-1]+arr[i+t-2]+arr[i+t-1])
  print(m)
#print(arr)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(t)

Submission status: Runtime Error

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

for i in range(2):
  if a[0] >= a[1]:
    t = t + a[0]
    a[0] = a[0] - 1
  else:
    t = t + a[1]
    a[1] = a[1]-1

print(t)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())

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

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
s = list(map(int,input()))
s.append(2)
start = s[0]
choku = [0]
saka = [0]
number = 1
for i in range(N):
    if s[i] == s[i+1]:
        number += 1
    else:
        if s[i] == 0:
            choku.append(number)
            number = 1
        else:
            saka.append(number)
            number = 1
choku.append(0)
saka.append(0)
while(1):
    max_align = 0
    m = len(choku)
    n = len(saka)
    if m <= K:
        print(N)
        break
    if start == 0: #最初が直立の場合
        for i in range(m-K+1):
            if max_align <= sum(choku[i:i+K]) + sum(saka[i-1:i+K]):
                max_align = sum(choku[i:i+K]) + sum(saka[i-1:i+K])
    else:
        for i in range(m-K+1):
            if max_align <= sum(choku[i:i+K]) + sum(saka[i:i+K+1]):
                max_align = sum(choku[i:i+K]) + sum(saka[i:i+K+1])
    print(max_align)
    break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
AB = list(map(int,input().split()))
m2 = 2*max(AB)-1
two = sum(AB)
if m2>=two:
    print(max2)
else:
    print(two)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
B = input()

m = max(A, B)
m = m + m +1

print(m)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input().sprit()
ans=0
if a[1]-1a[0]>=1:
  ans+=a[1]*2-1
elif a[0]-a[1]>=1:
  ans+=a[0]*2-1
else:
  ans+=a[0]+a[1]
print(ans)

Submission status: Runtime Error

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

n = int(input())
h = input().split()
count = 0
flag = 0

for i in range(n):
    #print(i)
    for j in range(i):
        if h[i] < h[i-1-j]:
            #print("{} {}".format(h[i-j], h[i]))
            flag = 1
            break
    if flag == 0:
        count += 1
    else:
        flag = 0

print(count)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = map(int, input().split())
hst = 0
cnt = 0
for i in l:
  if hst <= i:
    cnt += 1
    hst = i
print(cnt)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
>|python|
# -*- coding: utf-8 -*-

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

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

print(sum)
||<

Submission status: Runtime Error

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

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

print(sum_num):

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
s = input()
pre = s[0]
max_cnt = 0
stack = []
cnt = 0
s += '2'
if pre == '0':
    k -= 1
    stack = [0, 0]

for a in s:
    if a == pre:
        cnt += 1
    else:
        if a == '1':
            k -= 1
        if k < 0:
            stack.pop(0)
        stack.append(cnt)
        cnt = 1
        pre = a
        max_cnt = max(max_cnt, sum(stack))

print(max_cnt)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
s=1
for i in range(1,n):
  if l[i]>=max(l[0:i]):
    s=s+1
print(s)

Submission status: Runtime Error

Solution code:
A=int(input(''))
B=int(input(''))

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

Submission status: Runtime Error

Solution code:
#include <stdio.h>
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

int largest(int x, int y, int z){
	if(x > y){
		if(x > z){
			return x;
		}
		else{
			return z;
		}
	}
	else{
		if(y > z){
			return y;
		}
		else{
			return z;
		}
	}
}

int main(){
	int A, B;
	cin >> A >> B;
	cout << largest(2*A-1, A+B, 2*B-1) << "\n";
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Solution code:
print(sum([max([int(n) for n in input().strip().split()])-a for a in [0,1]]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if A > B:
  return A+A-1
elif A == B:
  return A+B
else:
  return B+B-1

Submission status: Runtime Error

Solution code:
if A > B:
  B B
elif A == B:
  A B
else:
  B B

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = list(input())
n_size = len(n)
count = 0
#print(n_size)  
new_list = []
new_list.append(int(n[0]))
for i in range(n_size-1):
  if new_list[i] == 0:
    new_list.append(1)
  else:
    new_list.append(0)

#print(new_list)
    
for i in range(n_size):
  if (int(n[i]) != int(new_list[i])):
    count+=1

#print(new_list)    
if n_size == 1:
  print(0)
else:
#  ans = n_size-count    
  print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
B = input()
x = 0

for num in range(1)
	if A < B;
		x = x + A
		A = A - 1
    else
    	x = x + B
      	B = B - 1
print(x)

Submission status: Runtime Error

Solution code:
if int(input()) == 1:
    msg = "Hello World!"
else:
    a = [int(input()) for i in range(2)]
    msg = a[0]+a[1]
print(msg)

Submission status: Runtime Error

Solution code:
line = raw_input()
lines = line.split()
a = int(lines[0])
b = int(lines[1])
res = 0
if a > b:
  res = a + a - 1
elif b > a:
  res = b + b - 1
else:
  res = a + b

print(res)

Submission status: Runtime Error

Solution code:
a=input()
A=int(a[0])
B=int(a[1])
if (A<B):
	print(B+B-1)
elif (A==B):
	print(A+B)
else:
	print(A+A-1)

Submission status: Runtime Error

Solution code:
a=input()
A=int(a[0])
B=int(a[2])
if (A<B):
	print(B+B-1)
elif (A==B):
	print(A+B)
else:
	print(A+A-1)

Submission status: Runtime Error

Solution code:
a=input()
A=int(a[0])
B=int(a[2])
if (A<B):
	print((2*B)-1)
elif (A==B):
	print(A+B)
else:
	print((2*A)-1)

Submission status: Runtime Error

Solution code:
a=input()
A=int(a[0])
B=int(a[2])
if (A<B):
	print(2*B-1)
elif (A==B):
	print(A+B)
else:
	print(2*A-1)

Submission status: Runtime Error

Solution code:
a=input('入力\n>>>')
A=int(a[0])
B=int(a[2])
if (A<B):
	print(2*B-1)
elif (A==B):
	print(A+B)
else:
	print(2*A-1)

Submission status: Runtime Error

Solution code:
a=input('入力\n>>>')
A=int(a[0])
B=int(a[2])
if (int(A<B)):
	print(2*B-1)
elif (A==B):
	print(A+B)
else:
	print(2*A-1)

Submission status: Runtime Error

Solution code:
A=input('入力１\n>>>')
B=input('入力２\n>>>')
if (int(A<B)):
	print(2*B-1)
elif (A==B):
	print(A+B)
else:
	print(2*A-1)

Submission status: Runtime Error

Solution code:
a=input('入力１\n>>>')
b=input('入力２\n>>>')
A=int(a)
B=int(b)
if (A<B):
	print(2*B-1)
elif (A==B):
	print(A+B)
else:
	print(2*A-1)

Submission status: Runtime Error

Solution code:
N = int(input())
arr = list(map(int,input().split()))
num = 0
tmp = 0

for data in arr:
	if data >= tmp:
		num += 1
		tmp = data

print(num)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

total = 0
maxN = 0
for num in h:
  if  num >= maxN:
    total += 1
  
  maxN = max(maxN,num)

print(total)

Submission status: Runtime Error

Solution code:
number = input()

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

total = 1
flag = True
    
for i in range(1,len(height)):

    for j in range(i):
        if height[i] >= height[j]:
            flag = True
        else:
            flag = False
    
    if flag:
        total += 1

print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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