Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(n(n+1)//2-n)

Fixed submission:
n = int(input())
print(n*(n+1)//2-n)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(1,n+1):
  a = i % n
  s.append(a)
ans = sum(s)
print(ans)

Fixed submission:
n = int(input())
print(n*(n+1)//2-n)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s  = str(input())
if n >= 3200:
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print('red')

Buggy python submission (verdict: Runtime Error):
a = int(input())
s  = input()
if n >= 3200:
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print('red')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(max[a+b,a-b,a*b])

Fixed submission:
a,b = map(int,input().split())
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
k,x = map(int,input().split())
for a in range(x-k+1,x+i):
    print(a ,end=" ")


Fixed submission:
k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")

Buggy python submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = range(b:a+1)
print(l)


Fixed submission:
k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")

Buggy python submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = range[b:a+1]
print(l)


Fixed submission:
k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")

Buggy python submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = rane[b:a+1]
print(l)


Fixed submission:
k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a+b) % 2 == 0:
  print((abs(x)+abs(y))//2)
else:
  print('IMPOSSIBLE')

Fixed submission:
A,B=map(int,input().split())
 
if((A+B)%2==0):
    print((A+B)//2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
if n*a >= b:
  print(b)
else:
  priny(n*a)

Fixed submission:
n,a,b = map(int,input().split())
if n*a >= b:
  print(b)
else:
  print(n*a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
ans = 0
for i in range(n-2):
    a,b,c=p[i:i+3]
    if a<b<c or c<b<a:  ans += 1
print(ans)


Fixed submission:
n = int(input())
s = list(map(int,input().split()))
ans = 0
for i in range(n-2):
    a,b,c = s[i:i+3]
    if a<b<c or c<b<a:  ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
  if a[i] < a[i+1] < a[i+2]:
    ans += 1
print(ans)
  

Fixed submission:
n = int(input())
s = list(map(int,input().split()))
ans = 0
for i in range(n-2):
    a,b,c = s[i:i+3]
    if a<b<c or c<b<a:  ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort()
a = n//2

ans = d[a]-d[a-1]

print(ans)


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
a = n//2

ans = l[a]-l[a-1]

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort()
b = l[n//2+1]-l[n//2+2]
print(b)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
a = n//2

ans = l[a]-l[a-1]

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort()
b = l[n//2+1]-[n//2+2]
print(b)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
a = n//2

ans = l[a]-l[a-1]

print(ans)
Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())
A = [L+i for i in range(N)]
A.sort(a: abs(a))

print(sum(A)-A[0])


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

A = [L + i for i in range(N)]
A.sort(key=lambda a: abs(a))

print(sum(A) - A[0])
Buggy python submission (verdict: Runtime Error):
x,a = map(int,input().split())
if x >= a:
  print(10)
else:
  priny(0)

Fixed submission:
x,a = map(int,input().split())
if x >= a:
  print(10)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
n,k = int(input()),int(input())
if n == k or n == 1:
  print(0)
else:
  print(n-k)

Fixed submission:
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)
Buggy python submission (verdict: Runtime Error):
a,p = map(int,input().split())
if 3*a+b < 2:
  print(0)
elif (3*a+b) % 2 == 0:
  print((3*a+b)//2)
else:
  print((3*a+b-1)//2)

Fixed submission:
a,p = map(int,input().split())
if 3*a+p < 2:
  print(0)
elif (3*a+p) % 2 == 0:
  print((3*a+p)//2)
else:
  print((3*a+p-1)//2)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l_max,r_min = 0,n
for i in range(m):
    l,r = map(int,input().split())
    l_max = max(l,ll)
    r_min = min(r,rr)
print(max(r_min - l_max +1 , 0))


Fixed submission:
n,m = map(int,input().split())
l_max,r_min = 0,n
for i in range(m):
    l,r = map(int,input().split())
    l_max = max(l,l_max)
    r_min = min(r,r_min)
print(max(r_min - l_max +1 , 0))
Buggy python submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(3001):
  for j in range(3001):
    for k in range(3001):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)


Fixed submission:
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)


Fixed submission:
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(n//r+1):
  for j in range(n//g+1):
    for k in range(n//b+1):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)


Fixed submission:
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(n//r+1):
  for j in range(n//g+1):
    for k in range(n//b+1):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)


Fixed submission:
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(r):
  for j in range(g):
    for k in range(b):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)

Fixed submission:
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
for i in range(n):
  if A[i]<0 and A[i+1]<0:
    A[i] = -A[i]
    A[i+1] = -A[i]
  elif A[i]<0:
    if A[i]-A[i+1]<0:
      A[i] = -A[i]
      A[i+1] = -A[i]
print(sum(A))
    

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
INF = 10**9

dp0 = [0]
dp1 = [-INF-1]

for i, x in enumerate(A):
  dp0.append( max(dp0[i] + x, dp1[i] - x) )
  dp1.append( max(dp0[i] - x, dp1[i] + x) )

print(dp0[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
S = input()
l = int(input())
A = str(S[l-1])
for i in range(n):
  if S[i] != A:
    S[i] = '*'
print(S)


Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] != s[k-1]:
    s = s.replace(s[i], '*')
print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
S = input()
l = int(input())
A = S[l+1]
for i in range(n):
  if S[i] != A:
    S[i] = '*'
print(S)


Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] != s[k-1]:
    s = s.replace(s[i], '*')
print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
S = input()
l = int(input())
A = S[l+1]
for i in range(n):
  if S[i] != A:
    S[i] = A
print(S)

Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] != s[k-1]:
    s = s.replace(s[i], '*')
print(s)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ptint(max(a+a-1,a+b,b+b-1))

Fixed submission:
a,b = map(int,input().split())
print(max(a+a-1,a+b,b+b-1))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ptint(max(a+a-1,a+b,b+b))

Fixed submission:
a,b = map(int,input().split())
print(max(a+a-1,a+b,b+b-1))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
ptint(max(a+a-1,a+b,b+b)

Fixed submission:
a,b = map(int,input().split())
print(max(a+a-1,a+b,b+b-1))
Buggy python submission (verdict: Runtime Error):
for i in range()
if i[4]-i[0] <= i[5]:
  print('Yay!')
else:
  print(':(')


Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k = map(int,input().split())
if abs(e-a) <= k:
  print('Yay!')
else:
  print(':(')

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e = map(int,input().split())
k = int(input())
if e-a < k:
  print('Yay!')
else:
  print(':(')

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k = map(int,input().split())
if e-a <= k:
  print('Yay!')
else:
  print(':(')

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
  print('Yay!')
else:
  print(':(')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a%10
B = b%10
C = c%10
D = d%10
E = e%10
List =[A,B,C,D,E]
ans = 0
for i in range(5):
  if l[i] % 10 != 0:
    mini = min(9,l[i])
print(a+b+c+d+e+A+B+C+D+E-(10-mini))

Fixed submission:
A = 0
B = []
B.append(0)
for i in range(5):
  I = int(input())
  A += I
  T = I % 10
  if T != 0:
    B.append(10 - T)
print(A + sum(B) - max(B))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a%10
B = b%10
C = c%10
D = d%10
E = e%10
list =[a,b,c,d,e]
ans = 0
for i in range(5):
  if l[i] % 10 != 0:
    mini = min(9,l[i])
print(a+b+c+d+e+A+B+C+D+E-mini)

Fixed submission:
A = 0
B = []
B.append(0)
for i in range(5):
  I = int(input())
  A += I
  T = I % 10
  if T != 0:
    B.append(10 - T)
print(A + sum(B) - max(B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
quank = [int(input()) for _ in range(N)]
b = min(quank)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)


Fixed submission:
N = int(input())
capacity = [int(input()) for _ in range(5)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)

Buggy python submission (verdict: Runtime Error):
N = int(input())
capacity = [int(input()) for _ in range(N)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)


Fixed submission:
N = int(input())
capacity = [int(input()) for _ in range(5)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)

Buggy python submission (verdict: Runtime Error):
N = int(input())
capacity = [int(input()) for _ in range(N)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)


Fixed submission:
N = int(input())
capacity = [int(input()) for _ in range(5)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
R = s.count('R')
B = len(s)-R
if R > B:
  print('Yes')
else:
  peint('No')

Fixed submission:
n = int(input())
s = input()

R = s.count('R')
B = len(s)-R

if R > B:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
ACGT = 0
for i in len(S):
  if S[i]=='A' or S[i]=='G' or S[i]=='C' or S[i]=='T':
    ACGT += 1
  else:
    ans = max(ans,ACGT)
    ACGT = 0
print(ans)


Fixed submission:
S = list(input())
M = 0
count = 0
for x in S:
  if x =="A" or x =="C" or x =="T" or x =="G":
    count += 1
  else:
    count = 0
  if M<count:
    M = count
print(M)

Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
ACGT = 0
for i in len(S):
  if S[i]=='A' or S[i]=='G' or A[i]=='C' or A[i]=='T':
    ACGT += 1
  else:
    ans = max(ans,ACGT)
    ACGT = 0
print(ans)

Fixed submission:
S = list(input())
M = 0
count = 0
for x in S:
  if x =="A" or x =="C" or x =="T" or x =="G":
    count += 1
  else:
    count = 0
  if M<count:
    M = count
print(M)

Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
ans = 0
for i in range(N):
for j in range(i, N):
if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
print(ans)
ans = max(ans, j - i + 1)

Fixed submission:
S = list(input())
M = 0
count = 0
for x in S:
  if x =="A" or x =="C" or x =="T" or x =="G":
    count += 1
  else:
    count = 0
  if M<count:
    M = count
print(M)
Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())
S = input()
for i in range(q):
  l,r = map(int,input().split())
  A = S[l,r+1]
  cnt = A.count('AC')
  print(cnt)
  

Fixed submission:
import numpy as np
N,Q = map(int,input().split())
S = np.array(list('_' + input()), dtype='U2')
A = (S == 'A')
C = (S == 'C')
AC = (A[:-1] & C[1:])
AC_cum = AC.cumsum()

for _ in range(Q):
  L,R = map(int,input().split())
  print(AC_cum[R-1] - AC_cum[L-1])
Buggy python submission (verdict: Runtime Error):
a = input()
b =a[0]+a[1]+a[2]+a[3]+a[5]+a[6]+a[8]+a[9]
c =int(a)
if c <= 20190430:
  print('Heisei')
else:
  print('TBD')

Fixed submission:
a = input()
b =a[0]+a[1]+a[2]+a[3]+a[5]+a[6]+a[8]+a[9]
c =int(b)
if c <= 20190430:
  print('Heisei')
else:
  print('TBD')
Buggy python submission (verdict: Runtime Error):
N,A,B,C = map(int,input().split())
l = [int(input()) for _ in range(n)]
INF=10**9

def dfs(cur, a, b, c):
  if cur == N:
    return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
  ret0 = dfs(cur + 1, a, b, c)
  ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
  ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
  ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
  return min(ret0, ret1, ret2, ret3)

print(dfs(0, 0, 0, 0))

Fixed submission:
N,A,B,C = map(int,input().split())
l = [int(input()) for i in range(N)]
INF = 100000000
def rec(i,a,b,c):
    if(i==N):
        return(abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF)
    ret0 = rec(i+1,a,b,c)
    ret1 = rec(i+1,a+l[i],b,c)+10
    ret2 = rec(i+1,a,b+l[i],c)+10
    ret3 = rec(i+1,a,b,c+l[i])+10
    return min(ret0,ret1,ret2,ret3)
print(rec(0,0,0,0))

Buggy python submission (verdict: Runtime Error):
n,a,b,c = map(int,input().split())
l = [int(input()) for _ in range(n)]
INF=10**9

def dfs(cur, a, b, c):
  if cur == N:
    return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
  ret0 = dfs(cur + 1, a, b, c)
  ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
  ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
  ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
  return min(ret0, ret1, ret2, ret3)

print(dfs(0, 0, 0, 0))

Fixed submission:
N,A,B,C = map(int,input().split())
l = [int(input()) for i in range(N)]
INF = 100000000
def rec(i,a,b,c):
    if(i==N):
        return(abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else INF)
    ret0 = rec(i+1,a,b,c)
    ret1 = rec(i+1,a+l[i],b,c)+10
    ret2 = rec(i+1,a,b+l[i],c)+10
    ret3 = rec(i+1,a,b,c+l[i])+10
    return min(ret0,ret1,ret2,ret3)
print(rec(0,0,0,0))
Buggy python submission (verdict: Runtime Error):
L = [map(int,input().split()) for _ in range(3)]
L.sort()
M = []
a = L.count('1')
b = L.count('2')
c = L.count('3')
d = L.count('4')
M.append(a)
M.append(b)
M.append(c)
M.append(d)
M.sort()
if M == [1,1,2,2]:
  print('YES')
else:
  print('NO')

Fixed submission:
L = []
for _ in range(3):
  A,B = map(int,input().split()) 
  L.append(A)
  L.append(B)
L.sort()
M = []
a = L.count(1)
b = L.count(2)
c = L.count(3)
d = L.count(4)
M.append(a)
M.append(b)
M.append(c)
M.append(d)
M.sort()
if M == [1,1,2,2]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input(),split())
if a+b - n > 0 :
  print(min(a,b),a+b-n)
else:
  print(min(a,b),0)

Fixed submission:
n,a,b = map(int,input().split())
if a+b - n > 0 :
  print(min(a,b),a+b-n)
else:
  print(min(a,b),0)
Buggy python submission (verdict: Runtime Error):
n,h,w = map(int,input().split())
print((n-h+1)*(n-w+1))

Fixed submission:
n = int(input())
h = int(input())
w = int(input())
print((n-h+1)*(n-w+1))

Buggy python submission (verdict: Runtime Error):
n,h,w = map(int,input(),split())
print((n-h+1)*(n-w+1))

Fixed submission:
n = int(input())
h = int(input())
w = int(input())
print((n-h+1)*(n-w+1))
Buggy python submission (verdict: Runtime Error):
 print('Christmas' + ' Eve' * (25 - int(input())))

Fixed submission:
D = int(input())
if D == 25:
  print('Christmas') 
elif D == 24:
  print('Christmas Eve') 
elif D == 23:
  print('Christmas Eve Eve') 
elif D == 22:
  print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
  s.append(int(input())
m = max(s)
print(sum(s)-m//2)


Fixed submission:
n = int(input())
p = [int(input()) for i in range(n)]
print(sum(p) - max(p) // 2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
  s.append(int(input())
m = max(s)
print(sum(s)-m//2)


Fixed submission:
n = int(input())
p = [int(input()) for i in range(n)]
print(sum(p) - max(p) // 2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
  s.append(int(input())
m = max(s)
print(sum(s)-m)


Fixed submission:
n = int(input())
p = [int(input()) for i in range(n)]
print(sum(p) - max(p) // 2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list()
[a = int(input()) for i in range(n):]
  s.add(a)
m = max(s)
print(sum(s)-m)

Fixed submission:
n = int(input())
p = [int(input()) for i in range(n)]
print(sum(p) - max(p) // 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
def dfs(s): # 文字列 s で始まる七五三数の個数 if int(s) > N:
  return 0
ret = 1 if all(s.count(c) > 0 for c in '753') else 0 # s 自体が七五三数なら +1 for c in '753':
         ret += dfs(s + c)
     return ret
print(dfs('0')) # 本当は dfs('') と書きたいが 4 行目でのエラーを防ぐため仕方なく

Fixed submission:
N = int(input())

ans = 0
a = [3, 5, 7]
i = 0
while a[i] <= N:
    x10 = a[i] * 10
    a.append(x10+3)
    a.append(x10+5)
    a.append(x10+7)
    i += 1

for j in range(i):
    s = str(a[j])
    if "3" in s and "5" in s and "7" in s:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
n = int(input())
if n < 357:
  print(0)
else:
  for i in range(n):
    s = str(i)
    if s.count('7')+s.count('5')+s.count('3') == len(s):
    ans += 1
print(ans)


Fixed submission:
N = int(input())

ans = 0
a = [3, 5, 7]
i = 0
while a[i] <= N:
    x10 = a[i] * 10
    a.append(x10+3)
    a.append(x10+5)
    a.append(x10+7)
    i += 1

for j in range(i):
    s = str(a[j])
    if "3" in s and "5" in s and "7" in s:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(n+1):
  s = str(i)
  if s.count('7')+s.count('5')+s.count('3') == int(s):
    ans += 1
print(ans)


Fixed submission:
N = int(input())

ans = 0
a = [3, 5, 7]
i = 0
while a[i] <= N:
    x10 = a[i] * 10
    a.append(x10+3)
    a.append(x10+5)
    a.append(x10+7)
    i += 1

for j in range(i):
    s = str(a[j])
    if "3" in s and "5" in s and "7" in s:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(n+1):
  s = str(input())
  if s.count('7')+s.count('5')+s.count('3') == int(s):
    ans += 1
print(ans)


Fixed submission:
N = int(input())

ans = 0
a = [3, 5, 7]
i = 0
while a[i] <= N:
    x10 = a[i] * 10
    a.append(x10+3)
    a.append(x10+5)
    a.append(x10+7)
    i += 1

for j in range(i):
    s = str(a[j])
    if "3" in s and "5" in s and "7" in s:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(n+1):
  s = list(str(input()))
  if s.count('7')+s.count('5')+s.count('3') == int(s):
    ans += 1
print(ans)

Fixed submission:
N = int(input())

ans = 0
a = [3, 5, 7]
i = 0
while a[i] <= N:
    x10 = a[i] * 10
    a.append(x10+3)
    a.append(x10+5)
    a.append(x10+7)
    i += 1

for j in range(i):
    s = str(a[j])
    if "3" in s and "5" in s and "7" in s:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
temp = []
for i in range(n):
  temp.append(a-(t-H[i]*0.006))
print(min(abs(temp)))

Fixed submission:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
temp = []
for i in range(n):
  temp.append(a-(t-H[i]*0.006))
temp_abs = [abs(j) for j in temp]
mini_temp_abs = min(temp_abs)
for k in range(n):
  if temp_abs[k] == mini_temp_abs:
    print(k+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if n == 1:
  print('Hello World')
else:
  print(a+b)

Fixed submission:
n = int(input())

if n == 1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if a == 1:
  print('Hello World')
else:
  print(a+b)

Fixed submission:
n = int(input())

if n == 1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
L = [a,b,c]
M = L.sorted()
print(int(str(M[2])+str(M[1]))+int(M[0]))

Fixed submission:
a,b,c = (map(int,input().split()))
L = [a,b,c]
M = L.sort()

print(L[-1]*10 + L[0] + L[1])

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
L = [a,b,c]
M = L.sorted()
ptint(int(str(M[2])+str(M[1]))+int(M[0]))

Fixed submission:
a,b,c = (map(int,input().split()))
L = [a,b,c]
M = L.sort()

print(L[-1]*10 + L[0] + L[1])
Buggy python submission (verdict: Runtime Error):
s = int(input())
t = int(input())

from collections import Counter
SC = Counter(s)
TC = Counter(t)

SCV = SC.values()
TCV = TC.values()

SCV.sort()
TCV.sort()
ans = 1
for i in range(len(s)):
  if SCV[i] != TCV[i]:
    ans = 0

if ans == 1:
  print('Yes')
else:
  print('No')
    
    


Fixed submission:
s=list(input())
t=list(input())
S=sorted(map(s.count,set(s)))
T=sorted(map(t.count,set(t)))
print("Yes" if S==T else "No")

Buggy python submission (verdict: Runtime Error):
s = int(input())
t = int(input())

from collections import Counter
SC = Counter(s)
TC = Counter(s)

SCV = SC.values()
TCV = TC.values()

SCV.sort()
TCV.sort()

if SCV == TCV:
  print('Yes')
else:
  print('No')


Fixed submission:
s=list(input())
t=list(input())
S=sorted(map(s.count,set(s)))
T=sorted(map(t.count,set(t)))
print("Yes" if S==T else "No")