Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())
red = [tuple(map(int, input().split())) for i in range(N)]
blue = [tuple(map(int, input().split())) for i in range(N)]

res = 0
for _blue in itertools.permutations(blue):
    sum_pair = len([1 for (a, b), (c, d) in zip(red, _blue) if a < c and b < d])
    res = max(res, sum_pair)
print(res)

Fixed submission:

N = int(input())
red = [list(map(int, input().split())) for i in range(N)]
blue = [list(map(int, input().split())) for i in range(N)]

red.sort(key=lambda x:x[1], reverse=True)
blue.sort()

c = 0
for bx, by in blue:
    for i, (rx, ry) in enumerate(red):
        if rx<bx and ry<by:
            c += 1
            red.pop(i)
            break

print(c)
Buggy python submission (verdict: Runtime Error):
print(input()[0]+input([1]+input()[2]))

Fixed submission:
print(input()[0]+input()[1]+input()[2])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = tuple(map(int, input().split()))

if k == 0:
    print(n*n)
    exit()
    
ans = 0
for a in range(k, n+1):
    ans += n-a
    b = np.arange(k+1, a-k+1)
    ans += np.sum((a%b)>=k)

print(ans)

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

ans = 0
for b in range(max(1, k), n+1):
    ans += (b-k)*(n//b)
    if n%b >= k and k>0:
        ans += n%b-k+1
    elif n%b >= k:
        ans += n%b
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = tuple(map(int, input().split()))

ans = 0
if k == 0:
    print(n*n)
    exit()
for a in range(max(1,k), n+1):
    ans += n-a
    b = np.arange(k+1, a+1)
    ans += np.sum((a%b)>=k)
print(ans)

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

ans = 0
for b in range(max(1, k), n+1):
    ans += (b-k)*(n//b)
    if n%b >= k and k>0:
        ans += n%b-k+1
    elif n%b >= k:
        ans += n%b
print(ans)

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

ans = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        x = i % j
        ans += 1 if x>=k else 0

print(ans)

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

ans = 0
for b in range(max(1, k), n+1):
    ans += (b-k)*(n//b)
    if n%b >= k and k>0:
        ans += n%b-k+1
    elif n%b >= k:
        ans += n%b
print(ans)
Buggy python submission (verdict: Runtime Error):
s = raw_input()
K = int(raw_input())
_s, _K = s[:], K
a = "abcdefghijklmnopqrstuvwxyz"
ai = a.index("a")
zi = a.index("z") 
si = [zi - a.index(c) + 1 if c != "a" else 0  for c in s]

def rotation_alphabet(s,i):
    return

for i, (c, ci) in enumerate(zip(s, si)):
    if K == 0:
        break
    if c == "a":
        continue
    if ci <= K:
        s = s[0:i] + "a" + s[i+1:]
        K = K - ci

if K > 0:
    s = s[:-1] + a[a.index(s[-1]) + K]

print(s)

Fixed submission:
s = raw_input()
K = int(raw_input())
_s, _K = s[:], K
a = "abcdefghijklmnopqrstuvwxyz"
ai = a.index("a")
zi = a.index("z") 
si = [zi - a.index(c) + 1 if c != "a" else 0  for c in s]

for i, (c, ci) in enumerate(zip(s, si)):
    if K == 0:
        break
    if c == "a":
        continue
    if ci <= K:
        s = s[0:i] + "a" + s[i+1:]
        K = K - ci

K = K % len(a)
if K > 0:
    s = s[:-1] + a[a.index(s[-1]) + K]

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
b = False
s = raw_input()
for d in range(len(s)):
    for f in range(d+2, len(s)+1):
        l = len(s[d:f])
        c = collections.Counter(s[d:f])
        if not b and l>=2 and c.most_common()[0][1] > l/2:
            print d+1, f
            b = True
if not b:
    print "-1 -1"


Fixed submission:
import collections
b = False
s = raw_input()
for i in range(len(s)-1):
    if not b and s[i] == s[i+1]:
        print i+1, i+2
        b = True
if not b:
    for i in range(len(s)-2):
        if not b and s[i] == s[i+2]:
            print i+1, i+3
            b = True
if not b:
    print "-1 -1"
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = []
for i in range(n):
    t.append(int(input()))
i = 0
while True:
    i+=1
    flag = True
    for j in range(n):
        if (i*max(t))%t[j] != 0:
            break
        if j == n-1:
            flag = False
    if flag == False:
        break
print(i*max(t))

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
N = int(input())
ans = 1
for i in range(0,N):
    t = int(input())
    ans = t * ans // gcd(ans, t)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,W = map(int, input().split())
weight=[]
values=[]
for idx in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    values.append(v)
dp=[[0]*(W+1) for i in range(N+1)]

for i in range(N):
    for j in range(W):
        if weight[i]<=j+1:
            dp[i+1][j+1] = max(dp[i][j+1-weight[i]]+values[i],dp[i][j+1])
        else:
            dp[i+1][j+1] = dp[i][j+1]

print(dp[N][W])


Fixed submission:
from collections import defaultdict
N,W = map(int, input().split())
wv = [list(map(int,input().split())) for _ in range(N)]

dp = defaultdict(int)
dp[0] = 0
for w, v in wv:
    dp_cur = list(dp.items())
    for w_cur, v_cur in dp_cur:
        if w_cur+w <= W:
            dp[w_cur+w] = max(dp[w_cur+w],v_cur+v)

print(max(dp.values()))
Buggy python submission (verdict: Runtime Error):
input_str = input()
input_list = input_str.split(' ')
a = input_list[0]
b = input_list[1]
c = input_list[2]
if a <= x:
    if x <= a + b:
        print('YES')
    else:
        print('NO')
else:
    print('NO')


Fixed submission:
input_str = input()
input_list = input_str.split(' ')
a = int(input_list[0])
b = int(input_list[1])
x = int(input_list[2])
if a <= x:
    if x <= a + b:
        print('YES')
    else:
        print('NO')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
e = input().split()

while True:
  print('take')

tmp = e[0].replace('0', '')
print(len(tmp))


Fixed submission:
e = input().split()

tmp = e[0].replace('0', '')
print(len(tmp))
Buggy python submission (verdict: Runtime Error):
    N = [int(i) for i in input().split()]
     
    if N[0] + N[1] >= N[2] and N[0] <= N[2]:
        print('YES')
    else:
        print('NO')

Fixed submission:
a, b, x = map(int, input().split())
 
n = x - a
 
if n >= 0 and b >=  n:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
    a, b, x = map(int, input().split())
     
    if a <= x <= a + b:
        print("YES")
    else:
        print("NO")

Fixed submission:
a, b, x = map(int, input().split())
 
n = x - a
 
if n >= 0 and b >=  n:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
    X=int(input())
    A=int(input())
    B=int(input())
    
    
    0<=B<=100
    if 0<=A<=100 and 0<=B<=100 and A<=X<=A+B;
    print("Yes")
    else;
    print("No")

Fixed submission:
a, b, x = map(int, input().split())
 
n = x - a
 
if n >= 0 and b >=  n:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
X=int(input())
0<=A<=100
0<=B<=100
if A<=X<=A+B;
print("Yes")
else;
print("No")

Fixed submission:
a, b, x = map(int, input().split())
 
n = x - a
 
if n >= 0 and b >=  n:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import math

N = int(input())

power = 1
for i in range(N):
    power *= i + 1
print(int(power) % int(math.pow(10, 9) + 7))

Fixed submission:
N = int(input())
C = 10**9+7
ans = 1
for i in range(1, N + 1):
    ans *= i
    ans %= C
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())
rates = [tuple(map(int, input().split())) for _ in range(N)]

now = nex = 1
for i in range(0, N - 1):
    nex = 1
    while True:
        if now * rates[i][0] <= nex * rates[i + 1][0] and now * rates[i][1] <= nex * rates[i + 1][1]:
            break
        nex += 1
    now = nex
print((rates[-1][0] + rates[-1][1]) * nex)

Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())
rates = [tuple(map(int, input().split())) for _ in range(N)]

a, b = 1, 1
n = 1
for i in range(N):
    n = max(-((-a) // rates[i][0]), -((-b) // rates[i][1]))
    a = rates[i][0] * n
    b = rates[i][1] * n
print(a + b)
Buggy python submission (verdict: Runtime Error):
s = input()

for c in s:
    if c == 'a':
        r = 1
    if c == 'b':
        r = 2
    if c == 'c':
        r = 4

if r = 7:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
r = 0

for c in s:
    if c == 'a':
        r += 1
    if c == 'b':
        r += 2
    if c == 'c':
        r += 4

if r == 7:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n, = map(int, input().split())
a = list(map(int, input().split()))
ans = []

h = a[0]
i = a[1]
s = h + abs(h-i)
if i < h:
    ans.append(-1 * abs(h-i))
else:
    ans.append(0)
for x in range(2, n+1):
    j = a[x]
    s += abs(i-j)
    if j < i:
        ans.append(-1 * abs(i-j))
    else:
        ans.append(0)
    h = i
    i = j

for x in ans:
    print(s+x)

Fixed submission:
n, = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
m = []

i = 0
j = a[0]
s = abs(a[0])
for x in range(1, n+1):
    k = a[x]
    s += abs(j-k)
    if i<=j<=k or k<=j<=i:
        m.append(0)
    else:
        ij = abs(i-j)
        jk = abs(j-k)
        if ij<jk:
            m.append(-2*ij)
        else:
            m.append(-2*jk)
    i = j
    j = k
for x in m:
    print(s+x)

Buggy python submission (verdict: Runtime Error):
n, = map(int, input().split())
a = list(map(int, input().split()))
ans = []

h = a[0]
i = a[1]
s = h + abs(h-i)
if i < h:
    ans[0] = -1 * abs(h-i)
else:
    ans[0] = 0
for x in range(2, n+1):
    j = a[x]
    s += abs(i-j)
    if j < i:
        ans[x] = -1 * abs(i-j)
    else:
        ans[x] = 0
    h = i
    i = j

for x in ans:
    print(s+x)

Fixed submission:
n, = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
m = []

i = 0
j = a[0]
s = abs(a[0])
for x in range(1, n+1):
    k = a[x]
    s += abs(j-k)
    if i<=j<=k or k<=j<=i:
        m.append(0)
    else:
        ij = abs(i-j)
        jk = abs(j-k)
        if ij<jk:
            m.append(-2*ij)
        else:
            m.append(-2*jk)
    i = j
    j = k
for x in m:
    print(s+x)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

X = input().split()


for i in range(N):
    x2 = [int(x) for x in X]
    del x2[i]
    x2.sort()
    
    print("%d"%x2[int((N/2)-1)])

Fixed submission:
N = int(input())

X = input().split()
x1 = [int(x) for x in X]
x2 = [int(x) for x in X]

x2.sort()
ml = x2[int((N/2)-1)]
mr = x2[int(N/2)]

for i in range(N):
    if x1[i] <=  ml:
        print("%d"%mr)
    else:
        print("%d"%ml)
Buggy python submission (verdict: Runtime Error):

n = int(input())
#日
d = int(input())
#合宿終了後のチョコレートの個数
x = int(input())




#i人目のA日目に食べた数を数える
num = 0

#配列
a = []

#３人分
for i in range(n):
    a.append(int(input()))
    for j in range(d):
        if a[i]*j +1 <= d:
            num += 1
    
    
    
    
            
print(num+x)

Fixed submission:

n = int(input())
#日
d,x = input().split()
#合宿終了後のチョコレートの個数





#i人目のA日目に食べた数を数える
num = 0

#配列
a = []

#３人分
for i in range(n):
    a.append(int(input()))
    for j in range(int(d)):
        if a[i]*j +1 <= int(d):
            num += 1
    
    
    
    
            
print(num+int(x))

Buggy python submission (verdict: Runtime Error):

n = int(input())
#日
d = int(input())
#合宿終了後のチョコレートの個数
x = int(input())




#i人目のA日目に食べた数を数える
num = 0

#配列
a = []

#３人分
for i in range(n):
    a.append(int(input()))

for i in range(n):
    for j in range(d):
        if a[i]*j +1 <= d:
            num += 1
        
    
    
    
    
            
print(num+x)

Fixed submission:

n = int(input())
#日
d,x = input().split()
#合宿終了後のチョコレートの個数





#i人目のA日目に食べた数を数える
num = 0

#配列
a = []

#３人分
for i in range(n):
    a.append(int(input()))
    for j in range(int(d)):
        if a[i]*j +1 <= int(d):
            num += 1
    
    
    
    
            
print(num+int(x))
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=list(map(lambda x:int(x), input().split()))
mi = n/2
sx=sorted(x)
for item in x:
    if item > sx[mi]:
	print(sx[mi])
    else:
	print(sx[mi+1])


Fixed submission:
n=int(input())
x=list(map(lambda x:int(x), input().split()))
mi = n//2 - 1
sx=sorted(x)
for item in x:
    if item > sx[mi]:
        print(sx[mi])
    else:
        print(sx[mi+1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=list(map(lambda x:int(x), input().split()))
mi = int(n/2)-1
sx=x[:]
sx.sort()
for item in x:
    cx=sx[:]
    cx.remove(item)
    print(cx[mi])

Fixed submission:
n=int(input())
x=list(map(lambda x:int(x), input().split()))
mi = n//2 - 1
sx=sorted(x)
for item in x:
    if item > sx[mi]:
        print(sx[mi])
    else:
        print(sx[mi+1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=list(map(lambda x:int(x), input().split()))
mi = int(n/2)-1
for i in range(n):
    cx = x[:]
    del	cx[i]
    cx.sort()
    print(cx[mi])

Fixed submission:
n=int(input())
x=list(map(lambda x:int(x), input().split()))
mi = n//2 - 1
sx=sorted(x)
for item in x:
    if item > sx[mi]:
        print(sx[mi])
    else:
        print(sx[mi+1])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())                                                                                     
a=list(map(lambda x:int(x), input().split()))                                                      
a.insert(0,0)                                                                                      
a.append(0)                                                                                        
count=0                                                                                            
d=[abs(a[i]-a[i+1]) for i in range(0, n+1)]                                                        
for i in range(1, n+1):                                                                            
    c=sum(d[:i-1])+sum(d[i+1:])                                                                    
    c+=abs(a[i-1]-a[i+1])                                                                          
    print(c)

Fixed submission:
n=int(input())
a=list(map(lambda x:int(x), input().split()))
a.insert(0,0)
a.append(0)
count=0
s=sum([abs(a[i]-a[i+1]) for i in range(0, n+1)])
for i in range(1, n+1):
    c=s+abs(a[i-1]-a[i+1])-(abs(a[i-1]-a[i])+abs(a[i]-a[i+1]))
    print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import math

n=int(input())
a=list(map(lambda x:int(x), input().split()))
for ri in range(n):
    count=0
    cpa	= a[:]
    cpa.pop(ri)
    cpa.insert(0, 0)
    cpa.append(0)
    for i in range(len(cpa)):
        if i+1>=len(cpa):
            break
        count+=math.fabs(cpa[i]-cpa[i+1])
    print(int(count))

Fixed submission:
n=int(input())
a=list(map(lambda x:int(x), input().split()))
a.insert(0,0)
a.append(0)
count=0
s=sum([abs(a[i]-a[i+1]) for i in range(0, n+1)])
for i in range(1, n+1):
    c=s+abs(a[i-1]-a[i+1])-(abs(a[i-1]-a[i])+abs(a[i]-a[i+1]))
    print(c)
Buggy python submission (verdict: Runtime Error):
a,b,c=list(map(lambda x:int(x), input().split()))
 print("Yes") if a+b>=c else print("No")

Fixed submission:
a,b,c=list(map(lambda x:int(x), input().split()))
print("Yes") if a+b>=c else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())

a = [i for i in map(int, input().split())]

total = []
x = 0
skip_total = []
for i in range(N-1):
    total.append(abs(a[i] - x))
    skip_total.append(abs(a[i+1] - x))
    x = a[i]
skip_total.append(abs(x - 0))
total.append(abs(a[N-1] - x))
x = a[N-1]
total.append(abs(x - 0))

print(skip_total[0] + sum(total[2:]))
for i in range(1, N-1):
    print(sum(total[0:i]) + skip_total[i] + sum(total[i+2:]))
print(sum(total[0:N-1]) + skip_total[N-1])


Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())

a = [i for i in map(int, input().split())]

a = [0] + a + [0]

total = 0
for i in range(N+1):
    total += abs(a[i] - a[i+1])

for i in range(1, N+1):
    print(total + abs(a[i-1] - a[i+1]) - (abs(a[i-1] - a[i]) + abs(a[i] - a[i+1])))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())

a = [i for i in map(int, input().split())]

total = []
x = 0
for i in range(N):
    total.append(abs(a[i] - x))
    x = a[i]
total.append(abs(x - 0))


skip_total = []
x = 0
for i in range(N-1):
    skip_total.append(abs(a[i+1] - x))
    x = a[i]
skip_total.append(abs(x - 0))

for i in range(N):
    if i == 0:
        print(skip_total[0] + sum(total[2:]))
    elif i == N-1:
        print(sum(total[0:N-1]) + skip_total[N-1])
    else:
        print(sum(total[0:i]) + skip_total[i] + sum(total[i+2:]))

Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())

a = [i for i in map(int, input().split())]

a = [0] + a + [0]

total = 0
for i in range(N+1):
    total += abs(a[i] - a[i+1])

for i in range(1, N+1):
    print(total + abs(a[i-1] - a[i+1]) - (abs(a[i-1] - a[i]) + abs(a[i] - a[i+1])))
Buggy python submission (verdict: Runtime Error):
A, B, X = map(int, raw_input().split())

if X >= A and X <= A + B:
    print('YES')
else:
    print('NO')


Fixed submission:
A, B, X = map(int, input().split())

if X >= A and X <= A + B:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
inputs = list(map(int,input()))
a = inputs[1]
b = inputs[2]
c = inputs[3]

if a + b >= c and a <= c:
  print("YES")
else:
  print("NO")

Fixed submission:
inputs = list(map(int,input().split(" ")))
a = inputs[0]
b = inputs[1]
c = inputs[2]
 
if a + b >= c and a <= c:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main():
    n, m, x = map(int, input().split())
    a = list(map(int, input().split()))
    print(min(len([b for b in a if b < x]), len([b for b in a if b > x])))

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

def main():
    a, b, x = map(int, input().split())
    print ('YES' if (x >= a and x <= a + b) else 'NO')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import copy

def main():
    n = int(input())
    x = list(map(int, input().split()))

    for i in range(n):
        t = copy.deepcopy(x)
        del t[i]
        t.sort()
        print(t[int(n / 2 - 1)])

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

import copy

def main():
    n = int(input())
    x = list(map(int, input().split()))

    t = copy.deepcopy(x)
    t.remove(min(x))
    t.sort()
    m1 = t[int(n / 2 - 1)]
    t = copy.deepcopy(x)
    t.remove(max(x))
    t.sort()
    m2 = t[int(n / 2 - 1)]
    for i in range(n):
        print(m1 if x[i] < m1 else m2)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import math

def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = max(a)
    a.remove(m)

    ans = m
    mx = -1
    for num in a:
        tmp = math.factorial(m) / (math.factorial(num) * math.factorial(m - num))
        if tmp > mx:
            mx = tmp
            ans = num

    print(m)
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = max(a)
    a.remove(m)

    ans = m
    h = m / 2
    dif = 9999999999
    for num in a:
        if abs(h - num) < dif:
            ans = num
            dif = abs(h - num)

    print(m)
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

    m = 0
    for i in range(n):
        dis = 0
        bef = 0
        if i != 0:
            if abs(a[i-1]) <= b and b <= abs(a[i+1]):
                print(m)
                continue;
        for idx, b in enumerate(a):
            if idx == i:
                continue
            dis += abs(bef - b)
            bef = b
        dis += abs(bef)
        if dis > m:
            m = dis
        print(dis)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

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

    dis = 0
    bef = 0
    for b in a:
        dis += abs(bef - b)
        bef = b
    dis += abs(bef)
    for i in range(n):
        m = 0 if i == 0 else a[i-1]
        l = 0 if i == len(a) - 1 else a[i+1]
        print(dis - (abs(m - a[i]) + abs(a[i] - l) - abs(m - l)))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

    for i in range(n):
        dis = 0
        bef = 0
        for idx, b in enumerate(a):
            if idx == i:
                continue
            dis += abs(bef - b)
            bef = b
        dis += abs(0 - bef)
        print(dis)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

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

    dis = 0
    bef = 0
    for b in a:
        dis += abs(bef - b)
        bef = b
    dis += abs(bef)
    for i in range(n):
        m = 0 if i == 0 else a[i-1]
        l = 0 if i == len(a) - 1 else a[i+1]
        print(dis - (abs(m - a[i]) + abs(a[i] - l) - abs(m - l)))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import sys

def main():
    args = sys.argv
    a, b = int(args[1]) ,int(args[2])
    result = 'Even' if ( a * b ) % 2 == 0 else 'Odd'
    print(result)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

import sys

def main():
    args = input().split()
    a, b = int(args[0]) ,int(args[1])
    result = 'Even' if ( a * b ) % 2 == 0 else 'Odd'
    print(result)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

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

    for a in range(n + 1):
        if (a * 10000 > y):
            continue
        for b in range((n + 1) - a):
            c = n - (a + b)
            if ((a * 10000 + b * 5000 + c * 1000) == y):
                print('{} {} {}'.format(a, b, c))
                exit()

    print(-1, -1, -1)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

def main():
    n, y = map(int, input().split())

    for a in range(n + 1):
        if (a * 10000 > y):
            continue
        for b in range((n + 1) - a):
            c = n - (a + b)
            if ((a * 10000 + b * 5000 + c * 1000) == y):
                print('{} {} {}'.format(a, b, c))
                exit()

    print(-1, -1, -1)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main():
    input_char_list = list(raw_input("type 3 digits number using only 0 or 1: "))
    count = 0
    for char in input_char_list:
        if char == '1':
            count += 1
    print(count)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
 
def main():
    input_char_list = list(input())
    count = 0
    for char in input_char_list:
        if char == '1':
            count += 1
    print(count)
 
if __name__ == '__main__':
    main()