Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split()) 
ab = []
for i in range(n):
  a, b = map(int, input().split()) 
  ab.append([a,b])

cd = []  
for i in range(n):
  c, d = map(int, input().split()) 
  cd.append([c,d])

for a, b in ab:
  distance = [abs(a-c) + abs(b-d) for c,d in cd]
  print(distance.index(min(distance))+1)

Fixed submission:
n, m = map(int, input().split()) 

ab = [list(map(int,input().split()))for _ in range(n)]
cd = [list(map(int,input().split()))for _ in range(m)] 

for a, b in ab:
  distance = [abs(a-c) + abs(b-d) for c,d in cd]
  print(distance.index(min(distance))+1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split()) 
ab = []
for i in range(n):
  a, b = map(int, input().split()) 
  ab.append([a,b])

cd = []  
for i in range(n):
  c, d = map(int, input().split()) 
  cd.append([c,d])

distance = []
for a, b in ab:
  for c, d in cd:
    distance.append(abs(a-c)+abs(b-d))
  print(distance.index(min(distance))+1)
  distance.clear()

Fixed submission:
n, m = map(int, input().split()) 

ab = [list(map(int,input().split()))for _ in range(n)]
cd = [list(map(int,input().split()))for _ in range(m)] 

for a, b in ab:
  distance = [abs(a-c) + abs(b-d) for c,d in cd]
  print(distance.index(min(distance))+1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split()) 
ab = []
for i in range(n):
  a, b = map(int, input().split()) 
  ab.append([a,b])

cd = []  
for i in range(n):
  c, d = map(int, input().split()) 
  cd.append([c,d])

d = {}
for i in range(len(ab)):
  for j in range(len(cd)):
    d[j+1] = abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1])
  print(min(d, key=d.get))

Fixed submission:
n, m = map(int, input().split()) 

ab = [list(map(int,input().split()))for _ in range(n)]
cd = [list(map(int,input().split()))for _ in range(m)] 

for a, b in ab:
  distance = [abs(a-c) + abs(b-d) for c,d in cd]
  print(distance.index(min(distance))+1)
Buggy python submission (verdict: Time Limit Exceeded):
n = input()

answer =  len(n)
number = int(n)
for a in range(1,number//2):
  if number%a != 0:
    continue
  b = number//a
  #print(a,b)
  answer = min(answer, max(len(str(a)), len(str(b))))
  
print(answer)

Fixed submission:
import math

n = input()
answer =  len(n)
number = int(n)
for a in range(int(math.sqrt(int(n))),1,-1):
  if number%a != 0:
    continue
  b = number//a
  answer = min(answer, max(len(str(a)),len(str(b))))
  break
  
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

power = 1
for i in range(1,n+1):
  power = power * i 

print(power%(10**9+7))

Fixed submission:
n = int(input())

power = 1
mod = 10**9+7
for i in range(1,n+1):
  power = power * i % mod

print(power)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = int(input())
mod = 10**9 + 7
a_list = [0] * (s + 1)
a_list[0] = 1
a_list[1] = 0
a_list[2] = 0
a_list[3] = 1
for i in range(4, s + 1):
    a_list[i] = a_list[i - 1] + a_list[i - 3]
    a_list[i] %= mod
print(a_list[s])

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = int(input())
mod = 10**9 + 7
a_list = [0] * (2000 + 1)
a_list[0] = 1
a_list[1] = 0
a_list[2] = 0
a_list[3] = 1
for i in range(4, s + 1):
    a_list[i] = a_list[i - 1] + a_list[i - 3]
    a_list[i] %= mod
print(a_list[s])
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
t = input()
min_count = 1000
for i in range(len(s) - len(t) + ):
    count = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            count += 1
    min_count = min(count, min_count)
    if min_count == 0:
        break
print(min_count)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
t = input()
min_count = 1000
for i in range(len(s) - len(t) + 1):
    count = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            count += 1
    min_count = min(count, min_count)
    if min_count == 0:
        break
print(min_count)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))

ans = 0
for i in range(n - 1):
    if a_list[i] == 0:
        continue
    for j in range(i + 1, n):
        ans += a_list[i] * a_list[j]
        if ans > 10 ** 9 + 6:
            ans = ans % (10 ** 9 + 7)
print(ans)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))
ans = 0
total = 0
mod = 10 ** 9 + 7
for i in range(n):
    total += a_list[i]
    if total >= mod:
        total = total % mod

for i in range(n - 1):
    total -= a_list[i]
    if total < 0:
        total += mod
    ans += a_list[i] * total
    if ans >= mod:
        ans = ans % mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))

for i in range(1, 10**9):
    x_list = [i]
    k = 0
    for i in range(1, n):
        x = a_list[0] ^ a_list[i] ^ x_list[0]
        x_list.append(x)
        k = k ^ x
    if a_list[0] == k:
        for i in range(0, n):
            print(x_list[i], end=" ")
        break

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))
y = 0
for a in a_list:
    y = y ^ a
for a in a_list:
    x = y ^ a
    print(x, end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
ans = 1
flag = 1
for a in map(int, input().split()):
    ans *= a
    if ans > 10 ** 18:
        flag = 0
    if a == 0:
        flag = 1
        break
if flag == 0:
    print(-1)
else:
    print(ans)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import numpy as np
n = int(input())
a_list = np.array(list(map(int, input().split())))
y = np.argsort(a_list)
if a_list[y[0]] == 0:
    print(0)
else:
    ans = 1
    flag = 1
    for i in range(0, n):
        ans *= int(a_list[y[n - 1 - i]])
        if ans > 10 ** 18:
            flag = 0
            break
    if flag == 0:
        print(-1)
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a_list = list(map(int, input().split()))
ans = 1
flag = 1
for a in a_list:
    ans *= a
    if ans > 10 ** 18:
        flag = 0
    if a == 0:
        flag = 1
if flag == 0:
    print(-1)
else:
    print(ans)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import numpy as np
n = int(input())
a_list = np.array(list(map(int, input().split())))
y = np.argsort(a_list)
if a_list[y[0]] == 0:
    print(0)
else:
    ans = 1
    flag = 1
    for i in range(0, n):
        ans *= int(a_list[y[n - 1 - i]])
        if ans > 10 ** 18:
            flag = 0
            break
    if flag == 0:
        print(-1)
    else:
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, k = map(int, input().split())
x = list(map(int, input().split()))
count = 1
machi = 0
machi_list = [0]
next_machi = x[machi] - 1
while True:
    if next_machi in machi_list:
        break
    count += 1
    machi_list.append(next_machi)
    machi = next_machi
    next_machi = x[machi] - 1

z = 0
for i in range(0, count):
    if machi_list[i] == next_machi:
        z = i
        break
loop_machi_list = machi_list[z:]
if k < z:
    machi = machi_list[k] + 1
    print(machi)
else:
    k = k - z
    machi = loop_machi_list[k % len(loop_machi_list)] + 1
    print(machi)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, k = map(int, input().split())
x = list(map(int, input().split()))
count = 1
machi = 0
machi_list = [0]
next_machi = x[machi] - 1
machi_dict = {}
while True:
    if next_machi in machi_dict:
        break
    count += 1
    machi_dict[next_machi] = 1
    machi_list.append(next_machi)
    machi = next_machi
    next_machi = x[machi] - 1

z = 0
for i in range(0, count):
    if machi_list[i] == next_machi:
        z = i
        break
loop_machi_list = machi_list[z:]
if k < z:
    machi = machi_list[k] + 1
    print(machi)
else:
    k = k - z
    machi = loop_machi_list[k % len(loop_machi_list)] + 1
    print(machi)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
a, b, n = map(int, input().split())
max_score = 0
for x in range(1, n + 1):
    score = int(a * x / b) - a * (x // b)
    if max_score < score:
        max_score = score
print(max_score)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
a, b, n = map(int, input().split())
max_score = 0
if n < b:
    max_score = int(a * n / b) - a * (n // b)
elif n == b:
    max_score = max(int(a * n / b) - a * (n // b), int(a * (n-1) / b) - a * ((n-1) // b))
elif a <= b:
    max_score = a - 1
elif a >= b:
    max_score = int(a * (b-1) / b) - a * ((b-1) // b)
else:
    for x in range(1, n + 1):
        score = int(a * x / b) - a * (x // b)
        if max_score < score:
            max_score = score
print(max_score)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
flag = 0
if a**(1 / 2) + b**(1 / 2) < c**(1 / 2):
    flag = 1
elif a**(1 / 2) + b**(1 / 2) > c**(1 / 2)
    flag = 0
else:
    flag = 1
    

if flag == 1:
    print("Yes")
else:
    print("No") 

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
a, b, c = map(int, input().split())
if 0 < (c - a - b) and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = input()
if n == "aaa" or  == "bbb":
    print("No")
else:
    print("Yes")




Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = input()
if n == "AAA" or n == "BBB":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, k = map(int, input().split())
p_list = list(map(int, input().split()))
score = []
for p in p_list:
    score.append((p + 1) / 2)

max_score = 0
for i in range(n - k + 1):
    max_score = max(max_score, sum(score[i:(i+k)]))
print(max_score)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, k = map(int, input().split())
p_list = list(map(int, input().split()))
score = []
for p in p_list:
    score.append((p + 1) / 2)

max_score = 0
flag = 0
total_score = 0
for i in range(n):
    if i < k - 1:
        total_score += score[i]
    else:
        total_score += score[i]
        max_score = max(max_score, total_score)
        total_score -= score[i - k + 1]
print(max_score)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
x = 0
y = 0
for i in range(0, n):
    if x <= y:
        x += a.pop(0)
    else:
        y += a.pop(-1)
print(abs(x - y))

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
x = 0
y = 0
be = 0
af = -1
for i in range(0, n):
    if x <= y:
        x += a[be]
        be += 1
    else:
        y += a[af]
        af -= 1
print(abs(x - y))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
b_c_hash = {}
c_list = []
for i in range(0,m):
    b, c = map(int, input().split())
    if c in b_c_hash:
        b_c_hash[c] += b
    else:
        b_c_hash[c] = b
        c_list.append(c)
c_list.sort(reverse=True)
k = 0
flag = 0
for c in c_list:
    for i in range(0, b_c_hash[c]):
        if a[k] < c:
            a[k] = c
            k += 1
        else:
            flag = 1
            break
    if flag == 1:
        break
print(sum(a))

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
b_c_hash = {}
c_list = []
for i in range(0,m):
    b, c = map(int, input().split())
    if c in b_c_hash:
        b_c_hash[c] += b
    else:
        b_c_hash[c] = b
        c_list.append(c)
c_list.sort(reverse=True)
k = 0
flag = 0
for c in c_list:
    for i in range(0, b_c_hash[c]):
        if k == n:
            flag = 1
            break
        if a[k] < c:
            a[k] = c
            k += 1
        else:
            flag = 1
            break
    if flag == 1:
        break
print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for i in range(0,m):
    b, c = map(int, input().split())
    for j in range(0,b):
        if a[j] < c:
            a[j] = c
        else:
            break
    if b != n:
        if a[b] < c:
            temp = []
            for j in range(0, n-b):
                if a[b] < c:
                    temp.append(a.pop(b))
                else:
                    break
            a = temp + a
print(sum(a))

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
b_c_hash = {}
c_list = []
for i in range(0,m):
    b, c = map(int, input().split())
    if c in b_c_hash:
        b_c_hash[c] += b
    else:
        b_c_hash[c] = b
        c_list.append(c)
c_list.sort(reverse=True)
k = 0
flag = 0
for c in c_list:
    for i in range(0, b_c_hash[c]):
        if k == n:
            flag = 1
            break
        if a[k] < c:
            a[k] = c
            k += 1
        else:
            flag = 1
            break
    if flag == 1:
        break
print(sum(a))
Buggy python submission (verdict: Runtime Error):
abc = input()
x = 0
for i range(0,3):
  if abc[i] == "1":
  	x += 1
print(x)

Fixed submission:
abc = input()
x = 0
for i in range(0,3):
  if abc[i] == "1":
  	x += 1
print(x)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
count = 0
outs = []
max_a = max(a)
max_index = a.index(max(a))
min_a = min(a)
min_index = a.index(min(a))
flag = -1
if 0 <= min_a:
  flag = 0
elif max_a <= 0:
  flag = n
elif max_a > -1 * min_a:
  flag = 0
  for i in range(0,n):
    if a[i] < 0:
      a[i] += max_a
      outs.append(str(max_index + 1) + " " + str(i + 1))
      count += 1
elif max_a < -1 * min_a:
  flag = n
  for i in range(0,n):
    if a[i] > 0:
      a[i] += min_a
      outs.append(str(min_index + 1) + " " + str(i + 1))
      count += 1

if flag == 0:
  for i in range(0, n-1):
    a[i+1] += a[i]
    outs.append(str(i + 1) + " " + str(i + 1 + 1))
    count += 1
elif flag == n:
  for i in range(0, n-1):
    a[n-i-1] += a[n-i]
    outs.append(str(n - i + 1) + " " + str(n - i - 1 + 1))
    count += 1
    
print(count)
for out in outs:
  print(out)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
count = 0
outs = []
max_a = max(a)
max_index = a.index(max(a))
min_a = min(a)
min_index = a.index(min(a))
flag = -1
if 0 <= min_a:
  flag = 0
elif max_a <= 0:
  flag = n
elif max_a > -1 * min_a:
  flag = 0
  for i in range(0,n):
    if a[i] < 0:
      a[i] += max_a
      outs.append(str(max_index + 1) + " " + str(i + 1))
      count += 1
elif max_a <= -1 * min_a:
  flag = n
  for i in range(0,n):
    if a[i] > 0:
      a[i] += min_a
      outs.append(str(min_index + 1) + " " + str(i + 1))
      count += 1

if flag == 0:
  for i in range(0, n-1):
    a[i+1] += a[i]
    outs.append(str(i + 1) + " " + str(i + 1 + 1))
    count += 1
elif flag == n:
  for i in range(1, n):
    a[n-i-1] += a[n-i]
    outs.append(str(n - i + 1) + " " + str(n - i - 1 + 1))
    count += 1
    
print(count)
for out in outs:
  print(out)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = list(map(int, input().split()))
hyoutei = []
for i in range(n-k+1):
    tmp = 0
    for j in range(i,k+i):
        tmp += a[j]
    hyoutei.append(tmp)

for i in range(n-k):
    if hyoutei[i] < hyoutei[i+1]:
        print("Yes")
    else:
        print("No")

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


for i in range(n-k):
    if (a[i] < a[i+k]):
        print("Yes")
    else: print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 1000000000000000000: print(-1)
else:print(ans)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
ans = 1
max = 10**18
if 0 in A:
    print(0)
    exit(0)
for i in range(n):
    ans *= A[i]
    if (ans > max):
        print(-1)
        exit(0)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,n=map(int,input().split())
ans=0
for x in range(n+1):
    tui=math.floor(a*x/b)-a*math.floor(x/b)
    ans=max(ans,tui)
print(ans)

Fixed submission:
import math
a,b,n=map(int,input().split())
c=min(b-1,n)
print(math.floor(a*c/b)-a*math.floor(c/b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
cnt = [0] * n
for i in a:
    cnt[i-1] += 1
for j in cnt:
    print(j)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a = a.sort()
for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
cnt = [0] * n
for i in a:
    cnt[i-1] += 1
for j in cnt:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
cnt = [0] * n
for i in a:
    cnt[i-1] += 1
for j in cnt:
    print(j)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(n):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        cnt += 1
print(cnt)

Fixed submission:
n = int(input())
s = input()
cnt = 0
for i in range(n-2):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(n):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                cnt += 1
print(cnt)

Fixed submission:
n = int(input())
s = input()
cnt = 0
for i in range(n-2):
    if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
ans=2018
for i in range(L,R+1):
  for j in range(L,R+1):
    if i>=j: continue
    cnt=(i*j)%2019
    ans=min(ans,cnt)
print(ans)

Fixed submission:
L,R=map(int,input().split())
if R-L>=2019:
    minimum=0
else:
    left,right=L%2019,R%2019
    minimum=2018**2
    for i in range(left,right+1):
        for j in range(i+1,right+1):
            minimum=min(minimum,i*j%2019)
print(minimum)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if max(a,b,c,d,e) - min(a,b,c,d,e) > k:
    print(":(")
else:
    print("Yay!"）

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if max(a,b,c,d,e) - min(a,b,c,d,e) > k:
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
d = int(intput())
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

Fixed submission:
d = int(input())
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
k = int(input())
odd = 0
for i in range(1, k+1):
  if i%2==0*
  odd += 1
even = k - odd
print(even * odd)

Fixed submission:
k = int(input())
odd = 0
for i in range(1, k+1):
  if i%2==0:
    odd += 1
even = k - odd
print(even * odd)
Buggy python submission (verdict: Runtime Error):
s = raw_input()
print (s.count("+") - s.count("-"))


Fixed submission:
s = input()
print (s.count("+") - s.count("-"))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a<= 8 and b <= 8:
  print("Yay!")
else:
print(":(")

Fixed submission:
a,b = map(int, input().split())
if a<= 8 and b <= 8:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
c=1
for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
print(c)

Fixed submission:
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)
Buggy python submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input.split())
print(min(s,m-s))

Fixed submission:
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b) = min(c,d))

Fixed submission:
li = [int(input()) for i in range(4)]
a = min(li[0], li[1])
b = min(li[2], li[3])
print(a+b)
Buggy python submission (verdict: Runtime Error):
s = input()
s = s.replece(s[3], "8")
print(s)

Fixed submission:
s = input()
print(s[:3]+"8"+s[4:])
Buggy python submission (verdict: Runtime Error):
s = input()
cnt = 0
for i in s:
  if i == '1':
    cnt += 1:
print(cnt)

Fixed submission:
s = input()
cnt = 0
for i in s:
  if i == '1':
    cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
c=1
for i in range(int(input())):
  if i**2<=n:c=i**2
print(c)

Fixed submission:
print(int(int(input())**.5)**2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
cnt=0
for i in range(n):
  List=map(int,input().split())
  cnt += List[1]-List[0]+1
print(cnt)

Fixed submission:
n=int(input())
cnt=0
for i in range(n):
  a,b=map(int,input().split())
  cnt += b-a+1
print(cnt)
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int, input().split())
A = max(x,a) - min(x,a)
B = max(x,b - min(x,b)
if A > B:
    print("B")
else:
    print("A")

Fixed submission:
x,a,b = map(int, input().split())
A = max(x,a) - min(x,a)
B = max(x,b) - min(x,b)
if A > B:
    print("B")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int, input().split())
if b-a <= 0:
  print("delicious")
elif b-a =< x:
  print("safe")
else:
  print("dangerous")

Fixed submission:
x,a,b = map(int, input().split())
if b-a <= 0:
  print("delicious")
elif b-a <= x:
  print("safe")
else:
  print("dangerous")
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[:5]+' '+s[6:13]+' '+a[14:])


Fixed submission:
s = input()
print(s[:5]+' '+s[6:13]+' '+s[14:])

Buggy python submission (verdict: Runtime Error):
s = input()
print(s[:5]+' '+s[6:13]+' '+a[14:])

Fixed submission:
s = input()
print(s[:5]+' '+s[6:13]+' '+s[14:])
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
aa = 0
for i in range(length(S)):
  if S[i] != T[i]:
    aa += 1
print(aa)
  


Fixed submission:
S = input()
T = input()
aa = 0
for i in range(len(S)):
  if S[i] != T[i]:
    aa += 1
print(aa)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input())
aa = list(map(int,input()))
aa.sort()
aaa = aa[:K]
print(sum(aaa))

Fixed submission:
N,K = map(int,input().split())
aa = list(map(int,input().split()))
aa.sort()
aaa = aa[:K]
print(sum(aaa))