Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

#リストをソート
a = sorted(a)
b = sorted(b)
c = sorted(c)

# x以上のイテレータを
def lower_bound(arr , x):
    l = 0
    r = len(c)
    for j in range(100):
        mid = (l + r) // 2
        # print(l , r , mid)
        if x <= arr[mid]:
            r = mid
        else:
            l = mid
    return r


count = 0
for i in range(n):
    a_count = lower_bound(a , b[i])
    c_count = len(c) - lower_bound(c , b[i] + 1)
    count += a_count * c_count

print(count)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

#リストをソート
a = sorted(a)
b = sorted(b)
c = sorted(c)

# x以上のイテレータを
def lower_bound(arr , x):
    l = 0
    r = len(c)
    for j in range(30):
        mid = (l + r) // 2
        # print(l , r , mid)
        if x <= arr[mid]:
            r = mid
        else:
            l = mid
    return r


count = 0
for i in range(n):
    a_count = lower_bound(a , b[i])
    c_count = len(c) - lower_bound(c , b[i] + 1)
    count += a_count * c_count

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=0
while(n>0):
  s=s+n%10;
  n=n//10
if(s%9==0):
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())

if(n%9==0):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 25/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, k = iia()
arr = iia()
tot = 1
for i in range(k):
    tot *= arr[i]

for i in range(k, n):
    cur = tot
    tot *= arr[i]
    tot //= arr[i - k]
    if tot > cur:
        print('Yes')
    else:
        print('No')
    

Fixed submission:
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 25/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, k = iia()
arr = iia()
tot = 1
for i in range(k, n):
    if arr[i] > arr[i - k]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 24/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, k = iia()
arr = iia()
dp = [0] * n
for i in range(1, n):
    cur = float("inf")
    for j in range(1, k + 1):
        if i - j >= 0:  
            t = abs(arr[i] - arr[i - j]) + dp[i - j]
            cur = min(cur, t)
        else:
            break
    dp[i] = cur
print(dp[-1])


Fixed submission:
# Author: S Mahesh Raju
# Username: maheshraju2020
# Date: 24/07/2020

from sys import stdin,stdout
from math import gcd, ceil, sqrt
from collections import Counter
from bisect import bisect_left, bisect_right
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n, k = iia()
arr = iia()
dp = [0] * n
for i in range(1, n):
    cur = float("inf")
    for j in range(1, k + 1):
        if i - j >= 0:  
            t = abs(arr[i] - arr[i - j]) + dp[i - j]
            cur = min(cur, t)
        else:
            break
    dp[i] = cur
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
x,y,m = map(int,input().split())
row = {}
ch = set()
column = {}
for i in range(m):
	h,k = map(int,input().split())
	ch.add((h,k))
	if h in row:
		row[h] += 1
	else:
		row[h] = 1
 
	if k in column:
		column[k] += 1
	else:
		column[k] = 1
 
 
r_max = 0
c_max = 0
 
for i in row:
	r_max = max(r_max,row[i])
for j in column:
	c_max = max(c_max,column[j])
 
r_inx = []
w_inx = []
 
for i in row:
	if row[i] == r_max:
		r_inx.append(i)
for j in column:
	if column[j] == c_max:
		w_inx.append(j)
 
flag = 0
for i in r_inx:
	for j in w_inx:
		if (i,j) not in ch:
			flag = 1
			break
if flag == 0:
	print(r_max+c_max-1)
else:
	print(r_max+c_max)
x,y,m = map(int,input().split())
row = {}
ch = set()
column = {}
for i in range(m):
	h,k = map(int,input().split())
	ch.add((h,k))
	if h in row:
		row[h] += 1
	else:
		row[h] = 1

	if k in column:
		column[k] += 1
	else:
		column[k] = 1


r_max = 0
c_max = 0

for i in row:
	r_max = max(r_max,row[i])
for j in column:
	c_max = max(c_max,column[j])

r_inx = []
w_inx = []

for i in row:
	if row[i] == r_max:
		r_inx.append(i)
for j in column:
	if column[j] == c_max:
		w_inx.append(j)

flag = 0

Fixed submission:
x,y,m = map(int,input().split())
row = {}
ch = set()
column = {}
for i in range(m):
	h,k = map(int,input().split())
	ch.add((h,k))
	if h in row:
		row[h] += 1
	else:
		row[h] = 1

	if k in column:
		column[k] += 1
	else:
		column[k] = 1


r_max = 0
c_max = 0

for i in row:
	r_max = max(r_max,row[i])
for j in column:
	c_max = max(c_max,column[j])

r_inx = []
w_inx = []

for i in row:
	if row[i] == r_max:
		r_inx.append(i)
for j in column:
	if column[j] == c_max:
		w_inx.append(j)

flag = 0
for i in r_inx:
	for j in w_inx:
		if (i,j) not in ch:
			flag = 1
			break
if flag == 0:
	print(r_max+c_max-1)
else:
	print(r_max+c_max)
Buggy python submission (verdict: Runtime Error):
print(sum([s != t for s, t in zip(input().split())]))

Fixed submission:
s = input()
t = input()
print(sum([s[i] != t[i] for i in range(len(s))]))
Buggy python submission (verdict: Runtime Error):
_,k=map(int,input().split())
print(sum(sorted(list(map(int,input(),split())))[:k]))

Fixed submission:
_,k=map(int,input().split())
print(sum(sorted(list(map(int,input().split())))[:k]))
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
MOD = 2019
 
if R - L >= 2019:
    print(0)
ans = (L * (L + 1)) % MOD
for i in range(L, R):
    for j in range(i + 1, R + 1):
        ans = min(ans, (i * j) % MOD)
 
print(ans)

Fixed submission:
L, R = map(int, input().split())
MOD = 2019

if R - L >= 2019:
    print(0)
    exit()
ans = (L * (L + 1)) % MOD
for i in range(L, R):
    for j in range(i + 1, R + 1):
        ans = min(ans, (i * j) % MOD)

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
A = list(map(int, input().split()))
ans = 1e9
for i in range(1, n):
    ans = min(ans, math.gcd(A[i], A[i - 1]))
print(ans)

Fixed submission:
def f(a, b):
    if a < b:
        d = a
        a = b
        b = d
    if a % b == 0:
        return b
    else:
        return f(b, a % b)

def main():
    n = int(input())
    A = list(map(int, input().split()))
    ans = int(1e9)
    for i in range(1, n):
        ans = min(ans, f(A[i], A[i - 1]))
    print(ans)

main()
Buggy python submission (verdict: Runtime Error):
S = input()
K = 'keyence'

bf = False
judge = False
kn = 0
for i in range(len(S)):
    if S[i] == K[kn]:
        if bf == True:
            judge = True
        kn += 1
    else:
        if judge == True:
            print('NO')
            exit()
        if bf == True:
            continue
        else:
            bf = True

if kn == 7:
    print('YES')
else:
    print('NO')

Fixed submission:
S = input()
for i in range(7):
    if S[:i] + S[-7+i:] == 'keyence':
        print('YES')
        exit()
print('NO')
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int n;
int lim;
vector<string> A;

void f(int digitNum, string s){ 
    vector<bool> J(3, false);
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '3') J[0] = true;
        if(s[i] == '5') J[1] = true;
        if(s[i] == '7') J[2] = true;
    }
    int idx = find(J.begin(), J.end(), false) - J.begin();
    if(idx == 3){
        A.push_back(s);
    }
    if(digitNum == lim){
        return;
    }
    f(digitNum + 1, s + '3');
    f(digitNum + 1, s + '5');
    f(digitNum + 1, s + '7');
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n;
    
    lim = to_string(n).length();
    
    if(lim < 3){
        cout << 0 << endl;
        return 0;
    }

    f(0, "");

    vector<int> B(A.size());
    for(int i = 0; i < A.size(); i++){
        B[i] = stoi(A[i]);
    }

    sort(B.begin(), B.end());

    int idx = lower_bound(B.begin(), B.end(), n) - B.begin();

    cout << idx + (B[idx] == n) << endl;

    return 0;
}

Fixed submission:
A = []
str = "357"
lim = 11

def dfs(bef, sz):
    if sz + 1 == lim:
        return
    for i in str:
        t = bef + i
        A.append(t)
        dfs(t, sz + 1)

def main():
    n = int(input())

    dfs("", 0)

    ans = 0

    for a in A:
        q = False
        w = False
        e = False
        for i in a:
            if i == '3':
                q = True
            elif i == '5':
                w = True
            elif i == '7':
                e = True
        if q and w and e:      
            ai = int(a)
            if ai <= n:
                ans += 1

    print(ans)

main()
Buggy python submission (verdict: Runtime Error):
N=int(input())
W=[]
S=set()
for i in range(N):
    w=input()
    W.append(w)
    last=W[0][-1]
S.add(W[0])
    
for i in range(1,N):
    if W[i][0]==last and not W[i] in S:
        pass
    else:
        print("No")
        exit()
    S.add(w[i])
    last=w[i][-1] #ケツ追加した
print("Yes")



Fixed submission:
def main():
    n = int(input())
    
    tmp = ""
    f = True
    st = []
    for i in range(n):
        w = input()
        st.append(w)
        if i > 0:
            if tmp[-1] == w[0]:
                pass
            else:
                f = False
        tmp = w
    if len(list(set(st))) != n:
        f = False
    
    print("Yes" if f else "No")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n=input()
A=list(map(int,input.split()))
t=sum(A)-1
ans=0
for a in A:
    ans += t % a
print(ans)


Fixed submission:
def main():
    n = int(input())
    A = list(map(int, input().split()))
    print(sum(A) - n)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a=input()
if a % 2 == 0:
  print(a)
else:
  print(a * 2)

Fixed submission:
n=int(input())
print(n if not n%2 else n*2)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print((b-a)*(1+b-a)//2-b)…

Fixed submission:
a,b=map(int,input().split())
print((b-a)*(1+b-a)//2-b)
Buggy python submission (verdict: Runtime Error):
X = input()

fx = 0
for x in X:
    fx += int(x)

if X % fx == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
def main():
    N = int(input())
    M = list(map(int, list(str(N))))

    t = 0
    for m in M:
        t += m

    if N % t == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
A, B, C, D = input()

op = ['+', '-']

for i in op:
    tmp = A + i + B
    for j in op:
        tmp += j + C
        for k in op:
            tmp += k + D
            if eval(tmp) == 7:
                print(tmp + '=7')
                exit()

Fixed submission:
def main():
    A = list(map(int,str(input())))

    s1 = "+"
    s2 = "+"
    s3 = "+"    

    if A[0] + A[1] + A[2] + A[3] == 7:
        s1 = "+"
        s2 = "+"
        s3 = "+"
    elif A[0] + A[1] + A[2] - A[3] == 7:
        s1 = "+"
        s2 = "+"
        s3 = "-"
    elif A[0] + A[1] - A[2] + A[3] == 7:
        s1 = "+"
        s2 = "-"
        s3 = "+"
    elif A[0] - A[1] + A[2] + A[3] == 7:   
        s1 = "-"
        s2 = "+"
        s3 = "+"
    elif A[0] + A[1] - A[2] - A[3] == 7:   
        s1 = "+"
        s2 = "-"
        s3 = "-"
    elif A[0] - A[1] + A[2] - A[3] == 7:   
        s1 = "-"
        s2 = "+"
        s3 = "-"
    elif A[0] - A[1] - A[2] + A[3] == 7:   
        s1 = "-"
        s2 = "-"
        s3 = "+"
    elif A[0] - A[1] - A[2] - A[3] == 7:   
        s1 = "-"
        s2 = "-"
        s3 = "-"

    print(str(A[0]) + s1 + str(A[1]) + s2 + str(A[2]) + s3 + str(A[3]) + "=7")


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    A = []
    for _ in range(n):
        a = int(input())
        if a in A:
            A.remove(a)
        else:
            A.append(a)
    print(len(A))
            

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n = int(input())
    B = set()
    for _ in range(n):
        b = int(input())
        if b in B:
            B.remove(b)
        else:
            B.add(b)
    print(len(B))
            

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# NとKを数値入力させる
N, K = map(int, input().split())

# 棒を入れるリストを用意する
A = []

# N本の棒の長さを入力させる
for i in range(N):
    # 数字を1つ入力させる
    a = int(input())

    # リストAに追加する
    A.append(a)

# リストAをソートする．このとき引数にreverse = Trueを設定すると降順になる（デフォルトは昇順）
A = sorted(A, reverse = True)

# 現在リストAには大きい順に棒の長さが格納されている．
# 大きい方からK本の長さの総和が最大値なので初期値0にしてK本分足していく
ans = 0
for i in range(K):
    ans += A[i]

print(ans)

Fixed submission:
n,k=input().split()
print(sum(sorted(list(map(int,input().split())))[:-int(k)-1:-1]))
Buggy python submission (verdict: Runtime Error):
r, g, b = input().split()
a = int(r + g + b)
print(["YES", "NO"][a % 4])

Fixed submission:
print(["NO","YES"][int(input().replace(" ", ""))%4==0])
Buggy python submission (verdict: Runtime Error):
A = map(int, input().split())
total = A[0] + A[1]
if total >= 10:
	print('error')
else:
	print(total)

Fixed submission:
a=eval(input().replace(" ","+"))
print(["error",a][a<10])
Buggy python submission (verdict: Runtime Error):
a=int(input())-int(input())
print(['LESS','EQUAL','GREATER'][a>=0 + a==0])

Fixed submission:
def main():
    s1, s2, s3 = list(input().split())
    print(s1[0].upper() + s2[0].upper() + s3[0].upper())

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
O = input()
E = input()

ans = ''
for i in range(min(len(O), len(E)):
    ans += O[i]
    ans += E[i]

if len(O) > len(E):
    ans += O[i]
elif len(O) < len(E):
    ans += E[i]

print(ans)

Fixed submission:
print("".join([a+b for a,b in zip(input(),input()+" ")]))

Buggy python submission (verdict: Runtime Error):
O = input()
E = input()

ans = ''
for i in range(min(O, E)):
    ans += O[i]
    ans += E[i]

if len(O) > len(E):
    ans += O[i]
elif len(O) < len(E):
    ans += E[i]

print(ans)

Fixed submission:
print("".join([a+b for a,b in zip(input(),input()+" ")]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def main():
    n = int(input())

    mi = sys.maxsize
    for x in range(1, n + 1):
        if n % x == 0:
            mi = min(mi, max(len(str(x)), len(str(int(n / x)))))
    print(mi)


if __name__ == "__main__":
    main()

Fixed submission:
import sys
def main():
    n = int(input())

    mi = sys.maxsize
    for x in range(1, n + 1):
        if x > int(n / x):
            break
        if n % x == 0:
            mi = min(mi, max(len(str(x)), len(str(int(n / x)))))
    print(mi)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    for i in range(1, N):
        N *= i
    print(N % (10 ** 9 + 7) )


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    N = int(input())
    for i in range(1, N):
        N = N * i % (10 ** 9 + 7)
    print(N)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    k, s = map(int, input().split())
    
    c = 0
    for x in range(k + 1):
        for y in range(k + 1):
            for z in range(k + 1):
                if x + y + z == s:
                    c += 1
    print(c)


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    k, s = map(int, input().split())
    
    c = 0
    for x in range(k + 1):
        for y in range(k + 1):
            if 0 <= s - (x + y) <= k:
                c += 1
    print(c)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range((len(s) - 1) ** 2):
    tmp = ''
    for j in range(len(s)):
        tmp += s[j]
        if i >> j & 1 == 1:
            tmp += '+'
    else:
        ans += eval(tmp)
else:
    print(ans)

Fixed submission:
def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            #print("i =", i, " ", ans, "+", tmp, "=", end = "")
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range((len(s) - 1) ** 2):
    tmp = ''
    for j in range(len(s)):
        tmp += s[j]
        if i >> j & 1:
            tmp += '+'
    else:
        ans += eval(tmp)
else:
    print(ans)

Fixed submission:
def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            #print("i =", i, " ", ans, "+", tmp, "=", end = "")
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    s = input()
    ans = 0
    for i in range((len(s) - 1) ** 2):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if (i >> j) & 1:
                tmp += "+"
        else:
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            #print("i =", i, " ", ans, "+", tmp, "=", end = "")
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    s = input()
    ans = 0
    for i in range((len(s) - 1) ** 2):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if (i >> j) & 1:
                tmp += "+"
        else:
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            #print("i =", i, " ", ans, "+", tmp, "=", end = "")
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np
N = int(input())

v = list(map(int,input().split()))
c = list(map(int,input().split()))

v2=np.array(v)
c2=np.array(c)

v2[np.argsort(v2)]
c2[np.argsort(c2)]

x = v2[0] + v2[2]
y = c2[0] + c2[2]
print(x-y)


Fixed submission:
# coding: utf-8
# Your code here!
V=[]
C=[]

ans=0
N=0
i=0
N=int(input())

li = input().split()

while(i<N):
    V.append(int(li[i]))
    i=i+1

i=0
li2=0
li2=input().split()

while(i<N):
    C.append(int(li2[i]))
    i = i+1
    
i=0

while(i<N):
    if(V[i]>C[i]):
        ans = ans + V[i] - C[i]
    i = i+1

print(ans)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np
N = int(input())

v = list(map(int,input().split()))
c = list(map(int,input().split()))

v2=np.array(v)
c2=np.array(c)

v2[np.argsort(v2)]
c2[np.argsort(c2)]

x = v2[-1] + v2[-2]
y = c2[-1] + c2[-2]
print(x-y)


Fixed submission:
# coding: utf-8
# Your code here!
V=[]
C=[]

ans=0
N=0
i=0
N=int(input())

li = input().split()

while(i<N):
    V.append(int(li[i]))
    i=i+1

i=0
li2=0
li2=input().split()

while(i<N):
    C.append(int(li2[i]))
    i = i+1
    
i=0

while(i<N):
    if(V[i]>C[i]):
        ans = ans + V[i] - C[i]
    i = i+1

print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count++
        
print(count)

Fixed submission:
#coding: utf-8
a, b = map(int, input().split())
result = 0
     
if(a>b):
    result += a
    a = a-1
else:
    result += b
    b = b-1
     
result += max(a,b)
print(result)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
a, b = map(int, input().split())
result = 0

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

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


Fixed submission:
#coding: utf-8
a, b = map(int, input().split())
result = 0
     
if(a>b):
    result += a
    a = a-1
else:
    result += b
    b = b-1
     
result += max(a,b)
print(result)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
minutes = [int(input()) for _ in range(5)]
time=0
l=[]
 
for i in minutes:
    time = time + i
    if(i%10==0):
        l.append(0)
    else:
        l.append(10-i%10)
 
l.sort()
time += sum(l[:-1])
print(time)


Fixed submission:
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count = count +1
        
print(count)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
minutes = [int(input()) for _ in range(5)]
time=0
l=[]

for i in minutes:
    time = time + i
    if(i%10==0):
        l.append(0)
    else:
        l.append(10-i%10)

l.sort()
time = time + sum(l[:-1])
print(time)

Fixed submission:
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count = count +1
        
print(count)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count++
        
print(count)

Fixed submission:
# coding: utf-8
n = int(input())

high = list(map(int, input().split()))
max_high = []
count =1

for i in range(1,n):
    x = high[:i]
    if(max(x) <= high[i]):
        count = count +1
        
print(count)