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


def main():
    count = 0
    n = int(input())
    for i in itertools.combinations(map(int, input().split()), 2):
        count += i[0]*i[1]
    return count % (10**9+7)


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


Fixed submission:
import itertools


def main():
    count = 0
    MOD = 10**9+7
    n = int(input())
    a = list(map(int, input().split()))
    s = [0]
    for i in range(n-1):
        s.append((s[i]+a[i]) % MOD)
    for ai, si in zip(a, s):
        count += (ai*si) % MOD
    return count % MOD


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

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


def main():
    n = int(input())
    a = map(int, input().split())
    count = 0
    for i in itertools.combinations(a, 2):
        count += i[0]*i[1]
    return count % (10**9+7)


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


Fixed submission:
import itertools


def main():
    count = 0
    MOD = 10**9+7
    n = int(input())
    a = list(map(int, input().split()))
    s = [0]
    for i in range(n-1):
        s.append((s[i]+a[i]) % MOD)
    for ai, si in zip(a, s):
        count += (ai*si) % MOD
    return count % MOD


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

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


def main():
    n = int(input())
    a = map(int, input().split())
    count = 0
    for i in list(itertools.combinations(a, 2)):
        count += i[0]*i[1]
    return count % (10**9+7)


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


Fixed submission:
import itertools


def main():
    count = 0
    MOD = 10**9+7
    n = int(input())
    a = list(map(int, input().split()))
    s = [0]
    for i in range(n-1):
        s.append((s[i]+a[i]) % MOD)
    for ai, si in zip(a, s):
        count += (ai*si) % MOD
    return count % MOD


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

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


def main():
    n = int(input())
    a = map(int, input().split())
    count = 0
    al = list(itertools.combinations(a, 2))
    for i in al:
        count += i[0]*i[1]
    return count % (10**9+7)


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


Fixed submission:
import itertools


def main():
    count = 0
    MOD = 10**9+7
    n = int(input())
    a = list(map(int, input().split()))
    s = [0]
    for i in range(n-1):
        s.append((s[i]+a[i]) % MOD)
    for ai, si in zip(a, s):
        count += (ai*si) % MOD
    return count % MOD


if __name__ == "__main__":
    print(main())
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for v in range(N)]
for v in ["AC", "WA", "TLE", "RE"]
    print("{0} x {1}".format(v, s.count(v)))

Fixed submission:
N = int(input())

R = ["AC", "WA", "TLE", "RE"]
C = [0, 0, 0, 0]

for i in range(N):
    S = input()
    if S == R[0]:
        C[0] += 1
    elif S == R[1]:
        C[1] += 1
    elif S == R[2]:
        C[2] += 1
    elif S == R[3]:
        C[3] += 1

for i in range(len(C)):
    print(R[i], "x", C[i])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
B=0
for i in range(N):
    L = [A[j] for j in range(i+1)]
    L.sort()
    B += L[i]-A[i]
print(B)


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=0
Mi=A[0]

for i in range(1,N):
    if A[i] > Mi:
        Mi = A[i]
    B += Mi - A[i]
print(B)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
A=list(map(int,input().split()))
L=list()
B=0
for i in range(N):
    L.append(A[i])
    L.sort()
    B += L[i]-A[i]
print(B)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=0
Mi=A[0]

for i in range(1,N):
    if A[i] > Mi:
        Mi = A[i]
    B += Mi - A[i]
print(B)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
L=list()
B=0
for i in range(N):
    L.append(A[i])
    B += max(L)-A[i]
print(B)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=0
Mi=A[0]

for i in range(1,N):
    if A[i] > Mi:
        Mi = A[i]
    B += Mi - A[i]
print(B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
count = 0
for i in range(1,N+1):
    for j in range(i+1,N+1):
        for k in range(j+1,N+1):
            if j-i != k-j and S[i-1] != S[j-1] and S[j-1]!=S[k-1] and S[k-1]!=S[i-1]:
                count += 1
print(count)



Fixed submission:
N = int(input())
S = input()
count = 0
r=0
g=0
b=0
#i,j,k-->i,j,2j-i
for i in range(N):
    if S[i]=="R":
        r+=1
    elif S[i]=="G":
        g+=1
    else:
        b+=1
    for j in range(i+1,N):
        if 2*j-i <= N-1:
            if S[i] != S[j] and S[j]!=S[2*j-i] and S[2*j-i]!=S[i]:
                count -= 1
count += r*g*b
print(count)
Buggy python submission (verdict: Runtime Error):
S = []
for _ in range(N):
  S.append(input().split())
G = []
for i in range(N):
  if S[i][0] == S[i][1]:
    G.append("1")
  else:
    G.append("0")

AN = (''.join(G))

if "111" in AN:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
S = []
for j in range(N):
  S.append(input().split())
G = []
for i in range(N):
  if S[i][0] == S[i][1]:
    G.append("1")
  else:
    G.append("0")

AN = (''.join(G))

if "111" in AN:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,M = int(input())
A = list(map(int, input().split())) 
S = 0
for i in M:
  S += A[i]
print (N-S)

Fixed submission:
N,M = map(int,input().split())    
A = list(map(int, input().split())) 
S = 0
for i in range(M):
  S += A[i]
F = N-S
if F>=0:
  print(F)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
A = str(input())
B = str(input())
C = 0
for i in range(3):
  if A[i] == B[i]:
    C += 0
print(c)
    


Fixed submission:
A = str(input())
B = str(input())
C = 0
for i in range(3):
  if A[i] == B[i]:
    C += 1
print(C)
Buggy python submission (verdict: Runtime Error):
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

s = input()
t = input()

a = []
for i in range(len(s) - len(t)):
    cnt = 0
    for j in range(len(t)):
        if t[j] == s[i + j]:
            cnt += 1
    a.append(cnt)
print(len(t) - max(a))


Fixed submission:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

s = input()
t = input()

a = []
for i in range(len(s) - len(t) + 1):
    cnt = 0
    for j in range(len(t)):
        if t[j] == s[i + j]:
            cnt += 1
    a.append(cnt)
print(len(t) - max(a))
Buggy python submission (verdict: Runtime Error):
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

n = int(input())
vh = {}
zx = []
zy = []
zh = []
for j in range(101):
    for k in range(101):
        vh[j, k] = -2
for i in range(n):
    x, y, h = list(map(int, input().split()))
    if h == 0:
        zx.append(x)
        zy.append(y)
        zh.append(h)
        continue
    for j in range(101):
        for k in range(101):
            hi = h + abs(j - x) + abs(k - y)
            if vh[j, k] == -2:
                vh[j, k] = hi
            elif vh[j, k] > -1:
                if vh[j, k] != hi:
                    vh[j, k] = -1

rs = 0
for j in range(101):
    for k in range(101):
        if vh[j, k] > -1:
            rs += 1
            rj = j
            rk = k

if rs == 1:
    print(rj, rk, vh[rj, rk])
else:
    for i in range(rs):
        dels = 0
        for j in range(101):
            for k in range(101):
                hi = zh + abs(j - zx) + abs(k - zy)
                if vh[j, k] > -1:
                    if vh[j, k] != hi:
                        dels += 1
        if dels == rs - 1:
            for j in range(101):
                for k in range(101):
                    hi = zh + abs(j - zx) + abs(k - zy)
                    if vh[j, k] > -1:
                        if vh[j, k] != hi:
                            vh[j, k] = -1
            for j in range(101):
                for k in range(101):
                    if vh[j, k] > -1:
                        print(j, k, vh[j, k])
                     


Fixed submission:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3
from collections import defaultdict

n = input()
if n == '1':
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3

n = int(input())
a = [int(_) for _ in input().split()]

p = a[0]
q = a[1]
r = a[2]
s = 0
for i in range(3, n):
    s += a[i]

d1 = 0
d3 = 2
while s - r > a[d3]:
    d3 += 1
    r += a[d3]
    s -= a[d3]

ans = float('inf')
for d2 in range(1, n - 1):
    ans = min(ans, max(p, q, r, s) - min(p, q, r, s))
    q += a[d2 + 1]
    while q - p > a[d1]:
        if d1 + 1 == d2 + 1:
            break
        d1 += 1
        p += a[d1]
        q -= a[d1]
    r -= a[d2 + 1]
    if d2 + 1 == d3:
        d3 += 1
        r += a[d3]
        s -= a[d3]
    while s - r > a[d3]:
        if d3  == n - 1:
            break
        d3 += 1
        r += a[d3]
        s -= a[d3]

print(ans)


Fixed submission:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

n = int(input())

if n % 2 == 1:
    print(n * 2)
else:
    print(n)
Buggy python submission (verdict: Runtime Error):
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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

t = 0
for i in a:
    m = i
    while m % 2 == 0:
        t += 1
        m /= 2

print(t)


Fixed submission:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

d, n = map(int, input().split())

a = 0
if d == 0:
    a = n
    if n == 100:
        a += 1
elif d == 1:
    a = 100 * n
    if n == 100:
        a += 100
elif d == 2:
    a = 100 * 100 * n
    if n == 100:
        a += 100 * 100

print(a)
Buggy python submission (verdict: Time Limit Exceeded):
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

s = input()
k = int(input())

all = set()
l = len(s)
for i in range(l):
    for j in range(i, l):
        all.add(s[i:j + 1])

print(sorted(all)[k - 1])


Fixed submission:
#!/usr/bin/python3

s = input()
k = int(input())

l = len(s)
all = set()
for i in range(l):
    cnt = 0
    for j in range(i, l):
        all.add(s[i:j + 1])
        cnt += 1
        if cnt >= k:
            break

print(sorted(all)[k - 1])
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [input() for i in range(h)]

ns = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(h):
    for j in range(w):
        if s[i][j] != '#':
            continue
        for dx, dy in ns:
            nx = i + dx
            ny = j + dy
            if nx < 0 or nx >= w:
                continue
            if ny < 0 or ny >= h:
                continue
            if s[nx][ny] == '#':
                break
        else:
            print('No')
            exit()

print('Yes')

Fixed submission:
#!/usr/bin/python3

h, w = map(int, input().split())
s = [input() for i in range(h)]

ns = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(h):
    for j in range(w):
        if s[i][j] != '#':
            continue
        for dx, dy in ns:
            nx = j + dx
            ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:
                if s[ny][nx] == '#':
                    break
        else:
            print('No')
            exit()

print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3

n, c = map(int, input().split())
x = [0]
v = [0]
ca = [0]
csum = 0
for i in range(n):
    xi, vi = map(int, input().split())
    x.append(xi)
    v.append(vi)
    csum += vi
    ca.append(csum)
x.append(c)

cb = [0]
for i in range(n):
    csum -= v[i]
    cb.append(csum)
cb.append(0)

gainMax = 0
for a in range(n + 1):
    for b in range(a + 1, n + 2):
        gain = ca[a] + cb[b]
        loss1 = x[a] * 2 + (c - x[b])
        loss2 = x[a] + (c - x[b]) * 2
        loss = min(loss1, loss2)
        gainMax = max(gainMax, gain - loss)

print(gainMax)

Fixed submission:
#!/usr/bin/python3

n, c = map(int, input().split())
x = [0]
v = [0]
ca = [0]
csum = 0
dmaxa1 = [0]
dmaxa2 = [0]
dmaxa1i = 0
dmaxa2i = 0
for i in range(n):
    xi, vi = map(int, input().split())
    x.append(xi)
    v.append(vi)
    csum += vi
    ca.append(csum)
    dmaxa1i = max(dmaxa1i, csum - xi)
    dmaxa2i = max(dmaxa2i, csum - xi * 2)
    dmaxa1.append(dmaxa1i)
    dmaxa2.append(dmaxa2i)
x.append(c)

cb = [0]
for i in range(n):
    csum -= v[i]
    cb.append(csum)
cb.append(0)

gainMax = 0
for b in range(1, n + 2):
    gain = cb[b]
    loss1 = (c - x[b]) * 2
    loss2 = c - x[b]
    d1 = dmaxa1[b - 1] + gain - loss1
    d2 = dmaxa2[b - 1] + gain - loss2
    gainMax = max(gainMax, max(d1, d2))

print(gainMax)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
count = 0

for i in range(1,n):
  for j in range(1,n):
    if(i*j < n):
      count += 1
      
print(count)

Fixed submission:
n = int(input())
count = ((n-1) * 2) -1

for i in range(2,n):
  if(i*2 >= n):
    break
  for j in range(2,n):
    if(i*j < n):
      count += 1
    else:
      break
    
print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
count = 0

for i in range(1,n):
  for j in range(1,n):
    if(a*b < n):
      count += 1
      
print(count)

Fixed submission:
n = int(input())
count = ((n-1) * 2) -1

for i in range(2,n):
  if(i*2 >= n):
    break
  for j in range(2,n):
    if(i*j < n):
      count += 1
    else:
      break
    
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(1,n):
  if(a[i-1] > a[i]):
    while(a[i-1] != a[i]):
      a[i] += 1
      ans += 1
    
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0
diff = 0

for i in range(1,n):
  if(a[i-1] > a[i]):
    diff = a[i-1] - a[i]
    a[i] += diff
    ans += diff
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x,k,d = map(int,input().split())

if(x < 0):
  while(x < 0):
    k -= 1
    x = x + d
    if(k == 0):
      break
  if(abs(x) > abs(x - d)):
    k += 1
    x = x - d
elif(x > 0):
  while(x > 0):
    k -= 1
    x = x - d
    if(k == 0):
      break
  if(abs(x) > abs(x + d)):
    k += 1
    x = x + d

if(x == 0):
  if(k%2 == 0):
    print(0)
  else:
  	print(d)
else:
  if(k%2 == 0):
    print(abs(x))
  else:
    print(min(abs(x+d),abs(x-d)))

Fixed submission:
x,k,d = map(int,input().split())

if(x < 0):
  i = int(abs(x)/d)
  if(k > i):
    k = k - i
    x = x + d*i
  else:
    x = x + d*k
    k = 0
  if(abs(x) > abs(x - d)):
    k += 1
    x = x - d
elif(x > 0):
  i = int(abs(x)/d)
  if(k > i):
    k = k - i
    x = x - d*i
  else:
    x = x - d*k
    k = 0
  if(abs(x) > abs(x + d)):
    k += 1
    x = x + d

if(x == 0):
  if(k%2 == 0):
    print(0)
  else:
  	print(d)
else:  
  if(k%2 == 0):
    print(abs(x))
  else:
    print(min(abs(x+d),abs(x-d)))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

int t = 0

for i in range(n):
  if(s[i] != t[i]):
    t+=1;
print(t)    




Fixed submission:
s = input()
t = input()

count = 0

for i in range(len(s)):
  if(s[i] != t[i]):
    count+=1;
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

if((b-a) > 0):
  for i in range(t):
    a += v
    b += w
  if(a >= b):
    print("YES")
  else:
    print("NO")
    
elif((b-a) < 0):
  for i in range(t):
    a -= v
    b -= w
  if(a <= b):
    print("YES")
  else:
    print("NO")
    

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

if((b-a) > 0):
  a = a+v*t
  b = b+w*t
  if(a >= b):
    print("YES")
  else:
    print("NO")
    
elif((b-a) < 0):
  a = a-v*t
  b = b-w*t
  if(a <= b):
    print("YES")
  else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a:
  print(0)
  exit()
  
for num in a:
  ans *= num
  
if(ans > 10**18):
  print(-1)
  exit()
  
print(ans)

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
frag = 10**18
a = list(map(int,input().split()))
  
ans = 1

for i in range(n):
  if(a[i] == 0):
    ans = 0
    break
  ans = ans * a[i]
    
if(ans > frag):
    ans = -1

print(ans)

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
frag = 10**18
a = list(map(int,input().split()))
  
ans = 1

for i in range(n):
  ans = ans * a[i]
    
if(ans > frag):
    ans = -1

print(ans)

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
frag = 10**18
a = list(map(int,input().split()))
  
ans = 1

for i in range(n):
  ans = ans * a[i]
    
if(ans > frag):
    ans = -1

print(ans)

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )

Buggy python submission (verdict: Runtime Error):
n = int(input())
frag = 10**9
a = list(map(float, input().split()))

for i in range(n):
  a[i] = a[i]/float(frag)
  
ans = 1

for i in range(n):
  ans = ans * a[i]

for i in range(n):  
	ans = ans * float(frag)
    
    
if(ans > 10**18):
    ans = -1

print(int(ans))

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )

Buggy python submission (verdict: Runtime Error):
a = list(map(float, input().split()))

for i in range(n):
  a[i] = a[i]/float(frag)
  
ans = 1

for i in range(n):
  ans = ans * a[i]

for i in range(n):  
	ans = ans * float(frag)
    
    
if(ans > 10**18):
    ans = -1

print(int(ans))

Fixed submission:
n = int( input() )
A = list( map( int,input().split() ) )
 
if 0 in A:
  print( 0 )
else:
  ret = 1
  for a in A:
    ret = ret * a
    if ret > 10 ** 18:
      ret = -1
      break
  print( ret )
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int,input().split())
ans = 0

for i in range(k):
  if(a != 0):
    ans += 1
    a -= 1
  elif(b != 0):
    b -= 1
  else:
    ans -= 1
    c -= 1
print(ans)



Fixed submission:
a,b,c,k = map(int,input().split())
ans = 0

if(k > a):
  ans = a
  k = k - a
else:
  ans = k
  k = k - a
if(k > 0):
  k = k - b
if(k > 0):
  ans = ans - k

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))
ans = 0

if(n <= k):
  print(0)
else:
  if(k == 0):
    print(sum(h))
  elif(int(n/2) <= k):
    for i in range(n-k):
      min_h = min(h)
      h[h.index(min_h)] = 10**18
      ans = ans + min_h
    print(ans)
  else:
    for i in range(k):
      max_h = max(h)
      h[h.index(max_h)] = 0
      print(sum(h))

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
ans = 0

if(n <= k):
  print(0)
else:
  h.sort()
  a = []
  a = h[:n-k]
  print(sum(a))

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

for i in range(k):
  max_h = max(h)
  h[h.index(max_h)] = 0
  
sum_h = sum(h)
if(sum_h == 0):
  print(0)
else:
  print(sum_h)

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
ans = 0

if(n <= k):
  print(0)
else:
  h.sort()
  a = []
  a = h[:n-k]
  print(sum(a))
Buggy python submission (verdict: Runtime Error):
N,Y = map(int, input().split())

for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Fixed submission:
date = input()

date_list = list(date)
date_list[3] = '8'
output = ''.join(date_list)

print(output)

Buggy python submission (verdict: Runtime Error):
N = int(input())
Y = int(input())

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Fixed submission:
date = input()

date_list = list(date)
date_list[3] = '8'
output = ''.join(date_list)

print(output)

Buggy python submission (verdict: Runtime Error):
answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            comb = [j,i,N-i-j]
            answer = [str(x) for x in comb]
            answer = ' '.join(answer)
            print(answer)
            exit()
if not(answer):
    print('-1 -1 -1')

Fixed submission:
date = input()

date_list = list(date)
date_list[3] = '8'
output = ''.join(date_list)

print(output)
Buggy python submission (verdict: Runtime Error):
N = int(input())
Y = int(input())

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Fixed submission:
N,Y = map(int, input().split())

for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Buggy python submission (verdict: Runtime Error):
N = int(input())
Y = int(input())

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            comb = [j,i,N-i-j]
            answer = [str(x) for x in comb]
            answer = ' '.join(answer)
            print(answer)
if not(answer):
    print('-1 -1 -1')

Fixed submission:
N,Y = map(int, input().split())

for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')
Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator

N = int(input())
power_list = [x+1 for x in range(N)]
result = functools.reduce(operator.mul, power_list)
print(result % (10**9+7))

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

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

Fixed submission:
N = int(input())
 
power = 1
for i in range(1,N+1):
    power *= i
    if power >= 10**9+7:
        power %= 10**9+7
print(power % (10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
total = 1;
for i in input().split():
    if i==0:
        total = 0;
        break
    total*=int(i)
if total>int(1e18):
    print(-1)
else : print(total)

Fixed submission:
n = int(input())
total = 1;
a = list(map(int, input().split()))
if 0 not in a:
    for i in a:
        total*=i
        if total>int(1e18):
            total = -1
            break
    print(total)
else: print(0)