Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
import sys
input = sys.stdin.readline


n, m = map(int, input().split())
if m == 0:
    print('Yes')
    exit()
edges = defaultdict(list)

for i in range(m):
    left, right, dist = map(int, input().split())
    edges[left-1].append((right-1, dist))
    edges[right-1].append((left-1, -dist))

seen = [None] * n
for node in range(n):
    if seen[node] is not None:
        continue

    seen[node] = 0
    todo = []
    while edges[node]:
        to, dis = edges[node].pop()
		seen[to] = dis
        todo.append([to, dis])
        
    while todo:
        new, dis = todo.pop()

        while edges[new]:
            to, n_dis = edges[new].pop()
            if seen[to] is None:
                seen[to] = dis + n_dis
            elif seen[to] != dis + n_dis:
                print('No')
                exit()
            todo.append([to, dis + n_dis])

print('Yes')


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
inf = float('INF')

n, m = map(int, input().split())
if m == 0:
    print('Yes')
    exit()
edges = defaultdict(list)

for i in range(m):
    left, right, dist = map(int, input().split())
    edges[left-1].append([right-1, dist])
    edges[right-1].append([left-1, -dist])

seen = [inf] * n
for node in range(n):
    if seen[node] != inf:
        continue

    seen[node] = 0
    todo = []
    while edges[node]:
        to, dis = edges[node].pop()
        todo.append([to, dis])
    while todo:
        new, dis = todo.pop()
        if seen[new] == inf:
            seen[new] = dis
        elif seen[new] != dis:
            print('No')
            exit()

        while edges[new]:
            to, n_dis = edges[new].pop()
            todo.append([to, dis + n_dis])

print('Yes')
Buggy python submission (verdict: Runtime Error):
n, total = map(int, input().split())

x = -1
y = -1
z = -1

for a in range(n+1):  #10000
    for b in range(n-a+1):  #5000
        c = n-a-b
        if total == 10000 * a + 5000 * b + 1000 * c:
            x, y, z = a, b, c
            break

print(x, y, z)


Fixed submission:
print(input().replace('2017', '2018'))
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a_tuple = tuple(map(int, input().split()))
a_set = set(a_tuple)
count_list = []

if k >= len(a_set):
    print(0)
else:
    for i in a_set:
        count = a_tuple.count(i)
        count_list.append(count)
    count_list.sort()
    ans = sum(count_list[:len(a_set)-k])
    print(ans)


Fixed submission:
print(sum(int(s) for s in input()))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a_tuple = tuple(map(int, input().split()))
a_set = set(a_tuple)
count_list = []

if k >= len(a_set):
    print(0)
else:
    for i in a_set:
        count = a_tuple.count(i)
        count_list.append(count)
    count_list.sort()
    ans = sum(count_list[:len(a_set)-k])
    print(ans)


Fixed submission:
import sys
from collections import defaultdict
input = sys.stdin.readline

n, k = map(int, input().split())
a_tuple = tuple(map(int, input().split()))
count_dict = defaultdict(int)

for i in a_tuple:
    count_dict[i] += 1

n = len(count_dict.keys())

if n <= k:
    print(0)
else:
    ans = sum(tuple(sorted(count_dict.values()))[:n-k])
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a_list = list(map(int, input().split()))
a_set = set(a_list)
count_list = []

if k >= len(a_set):
    print(0)
else:
    for i in a_set:
        count = a_list.count(i)
        count_list.append(count)
    count_list.sort()
    ans = sum(count_list[:len(a_set)-k])
    print(ans)


Fixed submission:
import sys
from collections import defaultdict
input = sys.stdin.readline

n, k = map(int, input().split())
a_tuple = tuple(map(int, input().split()))
count_dict = defaultdict(int)

for i in a_tuple:
    count_dict[i] += 1

n = len(count_dict.keys())

if n <= k:
    print(0)
else:
    ans = sum(tuple(sorted(count_dict.values()))[:n-k])
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a_list = list(map(int, input().split()))
a_set = set(a_list)
count_list = []

if k >= len(a_set):
    print(0)
else:
    for i in a_set:
        count = a_list.count(i)
        count_list.append(count)
    count_list.sort()
    ans = sum(count_list[:len(a_set)-k])
    print(ans)

Fixed submission:
import sys
from collections import defaultdict
input = sys.stdin.readline

n, k = map(int, input().split())
a_tuple = tuple(map(int, input().split()))
count_dict = defaultdict(int)

for i in a_tuple:
    count_dict[i] += 1

n = len(count_dict.keys())

if n <= k:
    print(0)
else:
    ans = sum(tuple(sorted(count_dict.values()))[:n-k])
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
graph = []
Y = []
X = []
for _ in range(n):
    x, y = map(int, input().split())
    graph.append([x, y])
    Y.append(y)
    X.append(x)

Y.sort()
X.sort()
ans = []
for sx in range(n):
    for ex in range(n-1, sx, -1):
        for sy in range(n):
            for ey in range(n-1, sy, -1):
                x1, x2, y1, y2 = X[sx], X[ex], Y[sy], Y[ey]
                count = len([True for x, y in graph if x1 <= x <= x2 and y1 <= y <= y2])
                if count >= k:
                    ans.append((x2-x1)*(y2-y1))
                else:
                    break

print(min(ans))

Fixed submission:
n, k = map(int, input().split())
graph = []
Y = []
X = []
for _ in range(n):
    x, y = map(int, input().split())
    graph.append([x, y])
    Y.append(y)
    X.append(x)

Y.sort()
X.sort()
ans = []
for sx in range(n):
    for ex in range(n-1, sx, -1):
        for sy in range(n):
            for ey in range(n-1, sy, -1):
                x1, x2, y1, y2 = X[sx], X[ex], Y[sy], Y[ey]
                count = len([True for x, y in graph if x1 <= x <= x2 and y1 <= y <= y2])
                if count >= k:
                    ans.append((x2-x1)*(y2-y1))
                else:
                    break

print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)

n, m = map(int, (input().split()))
dic = defaultdict(list)
seen = [False] * (n+1)

for _ in range(m):
    a, b = map(int, input().split())
    dic[a].append(b)
    dic[b].append(a)


def dfs(v, todo,  depth):
    if depth == 3:
        if v not in dic[root]:
            global count
            count += 1
            dic[root].append(v)
            dic[v].append(root)
        return

    for new_v in todo:
        if new_v == root:
            continue
        new_todo = []
        new_todo += dic[new_v]
        new_todo.remove(v)
        dfs(new_v, new_todo, depth+1)


count = 0
for i in range(1, n+1):
    root = i
    todo = dic[i]
    dfs(i, todo, 0)

print(count)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

n, m = map(int, (input().split()))
dic = defaultdict(list)
seen = [-1] * (n+1)

for _ in range(m):
    a, b = map(int, input().split())
    dic[a].append(b)
    dic[b].append(a)


def dfs(v, todo, color):
    if seen[v] == color:  # 同じ色で戻ってくる = 偶サイクル
        return
    elif seen[v] == 1-color:  # 異なる色で戻ってくる = 奇サイクル
        global odd_cycle
        odd_cycle = True
        return

    seen[v] = color
    for new_v in todo:
        new_todo = dic[new_v]
        dfs(new_v, new_todo, 1-color)


odd_cycle = False
dfs(1, dic[1], 0)
if odd_cycle:
    ans = 0.5 * n * (n-1) - m
else:
    black = seen.count(0)
    white = seen.count(1)
    ans = black * white - m

print(int(ans))
Buggy python submission (verdict: Runtime Error):
text = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

for s in text:
    alphabet = alphabet.replace(s, '')

if alphabet is False:
    print('None')
else:
    print(alphabet[0])

Fixed submission:
text = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

for s in text:
    alphabet = alphabet.replace(s, '')

if alphabet is '':
    print('None')
else:
    print(alphabet[0])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = [int(input()) for _ in range(n)]
checked = []
num = 0
count = 0

while num not in checked:
    checked.append(num)
    num = a_list[num] - 1
    count += 1
    if num == 1:
        break

if num == 1:
    print(count)
else:
    print(-1)

Fixed submission:
import sys
input = sys.stdin.readline

n = int(input())
a_tuple = tuple(int(input()) for _ in range(n))
num = 0
count = 0

for i in range(n):
    num = a_tuple[num] - 1
    count += 1
    if num == 1:
        break

if num == 1:
    print(count)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = list(map(int, input().split()))

total = 0
count = 0
pos_or_neg = True  # True = +, False = -

if sum(a_list) >= 0:
    if n % 2 == 0:
        pos_or_neg = False
    else:
        pos_or_neg = True
else:
    if n % 2 == 0:
        pos_or_neg = True
    else:
        pos_or_neg = False

for a in a_list:
    total += a
    if pos_or_neg:
        while total <= 0:
            total += 1
            count += 1
        pos_or_neg = False

    else:
        while total >= 0:
            total -= 1
            count += 1
        pos_or_neg = True

print(count)

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

total = 0
count = 0
pos_or_neg = True  # True = +, False = -

for a in a_list:
    total += a
    if pos_or_neg:
        if total <= 0:
            count += -total + 1
            total += -total + 1
        pos_or_neg = False

    else:
        if total >= 0:
            count += total + 1
            total -= total + 1
        pos_or_neg = True

first_count = count
count = 0
total = 0
pos_or_neg = False

for a in a_list:
    total += a
    if pos_or_neg:
        if total <= 0:
            count += -total + 1
            total += -total + 1
        pos_or_neg = False

    else:
        if total >= 0:
            count += total + 1
            total -= total + 1
        pos_or_neg = True

print(min(count, first_count))
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(((n+999)//1000)*1000 - N)

Fixed submission:
n = int(input())
if n % 1000 == 0:
    print(0)
else:
    print((n // 1000 + 1)*1000 - n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [0]*(n+1)
asum = 1

for i in range(2,n+1):
    a[i] += 1
    for k in range(i,n+1,i):
        a[k] += 1
    asum += i*a[i]
print(asum)

Fixed submission:
n = int(input())
a = [0]*(n+1)
asum = 1

for i in range(2,n+1):
    a[i] += 1
    for k in range(i,n+1,i):
      a[k] += 1
    asum += i*a[i]
print(asum)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
c = 1
for a in A:
	c *= a
    if c > 10**18:
         print("-1")
         quit()
print(c)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
c = 1
flag = True
for _ in a:
    c *= _
    if c > 10**18:
        flag = False
        c = 1
    if c == 0:
        print(0)
        quit()
if flag:
    print(c)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split())
c = 1
for a in A:
	c *= a
    if c > 10**18:
         print("-1")
         quit()
print(c)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
c = 1
flag = True
for _ in a:
    c *= _
    if c > 10**18:
        flag = False
        c = 1
    if c == 0:
        print(0)
        quit()
if flag:
    print(c)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
l = ["p","p","h","b","h","h","p","h","p","h"]
n = input()
print(l[int(n[2])] + "on")

Fixed submission:
l = ["p","p","h","b","h","h","p","h","p","h"]
n = input()
print(l[int(n[-1])] + "on")
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = map(int,input().split())
c = k
while(c <= b):
	if a <= k <= b:
		print("OK")
		quit()
    c += k
print("NG")

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if a % k == 0:
    c = a
else:
    c = (a // k) * k + k
if c <= b:
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = []
for i in range(N):
    s = input()
    if not s in lis:
        lis.append(s)
print(len(lis))

Fixed submission:
N = int(input())
lis = []
for i in range(N):
    s = input()
    lis.append(s)
lis = set(lis)
print(len(lis))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = []
for i in range(N):
    s = input()
    if not s in lis:
        lis.append(s)
print(len(lis))

Fixed submission:
N = int(input())
lis = []
for i in range(N):
    s = input()
    lis.append(s)
lis = set(lis)
print(len(lis))
Buggy python submission (verdict: Runtime Error):
def main():
  N = int(input())
  S = input()
  R = 0
  G = 0
  B = 0
  nsum = 0
  for s in S:
      if s == "R":
          R += 1
      elif s == "G":
          G += 1
      else:
          B += 1
  count = 0
  for i in range(N):
      for k in range(i+1,N):
          if not S[i] == S[k]:
              if 2*k - i <= N - 1:
                  if S[i] != S[2*k - i] and S[k] != S[2*k - i]:
                      count += 1
  print(R*G*B - count)

if __name__ == '__main__':
    main()

Fixed submission:
N = input()
if N[0] == "7" or N[1] == "7" or N[2] == "7":
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
a = [0 for _ in range(N - 1)]

for lt in range(1, N+1):
    for rt in range(lt+1, N+1):
        a[min(rt-lt-1, abs(X-lt) + abs(Y-rt))] += 1

print(*a, sep="\n")

Fixed submission:
S = input()

if (S[2] == S[3]) and (S[4] == S[5]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
S = "0" * N

for i in range(M):
    s,c = map(int,input().split())
    if s == 1 and c == 0 and N != 1:
        print("-1")
        quit()
    elif S[s-1] == "0" or S[s-1] == str(c):
        S = S[0:s-1] + str(c) + S[s:-1]
    else:
        print("-1")
        quit()

if S[0] == "0" and N != 1:
    S = "1" + S[1:-1]

print(S)

Fixed submission:
N, M = map(int,input().split())
S = []
C = []
flag = True
if N == 1 and M == 0:
    print("0")
    quit()

for i in range(M):
    s,c = map(int,input().split())
    if s in S:
        if C[S.index(s)] != c:
            flag = False
            break
    if s == 1 and N > 1:
        if c == 0:
            flag = False
            break
    S.append(s)
    C.append(c)

if flag:
    n = [1] + [0 for i in range(N - 1)]
    for i in range(len(S)):
        n[S[i]-1] = C[i]
    print(*n, sep="")
else:
    print("-1")

Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
S = "0" * N
for i in range(M):
    s,c = map(int,input().split())
    if S[s-1] == "0" or S[s-1] == str(c):
        S = S[0:s-1] + str(c) + S[s:-1]
        print(S)
    else:
        print("-1")

if S[0] == "0" and N != 1:
    S = "1" + S[1:-1]

print(S)

Fixed submission:
N, M = map(int,input().split())
S = []
C = []
flag = True
if N == 1 and M == 0:
    print("0")
    quit()

for i in range(M):
    s,c = map(int,input().split())
    if s in S:
        if C[S.index(s)] != c:
            flag = False
            break
    if s == 1 and N > 1:
        if c == 0:
            flag = False
            break
    S.append(s)
    C.append(c)

if flag:
    n = [1] + [0 for i in range(N - 1)]
    for i in range(len(S)):
        n[S[i]-1] = C[i]
    print(*n, sep="")
else:
    print("-1")

Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
S = []
C = []
flag = True
for i in range(M):
    s,c = map(int,input().split())
    if s in S:
        if C[S.index(s)] != c:
            flag = False
            break
    if s == M:
        if c == 0:
            flag = False
            break
    S.append(s)
    C.append(c)

if flag:
    n = [1] + [0 for i in range(M - 1)]
    for i in range(len(S)):
        n[S[i]-1] = C[i]
    print(*n, sep="")
else:
    print("-1")

Fixed submission:
N, M = map(int,input().split())
S = []
C = []
flag = True
if N == 1 and M == 0:
    print("0")
    quit()

for i in range(M):
    s,c = map(int,input().split())
    if s in S:
        if C[S.index(s)] != c:
            flag = False
            break
    if s == 1 and N > 1:
        if c == 0:
            flag = False
            break
    S.append(s)
    C.append(c)

if flag:
    n = [1] + [0 for i in range(N - 1)]
    for i in range(len(S)):
        n[S[i]-1] = C[i]
    print(*n, sep="")
else:
    print("-1")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
flag = True
for i in range(len(A)):
  for k in range(i + 1, len(A)):
      if A[i] == A[k]:
        flag = False
        break
if flag:
  print("YES")
else:
  print("NO")

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
flag = True
A.sort()
for i in range(1,len(A)):
  if A[i-1] == A[i]:
    flag = False

if flag:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int,input().split())

p = list(map(int,input().split()))
for n in range(N):
  p[n] = p[n] / 2 + 1 / 2
max = 0
for n in range(N-K+1):
  sum = 0
  for i in range(n, n + K):
    sum += p[i]
  if max < sum:
    max = sum
print(max)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
ps = [p[0]] + [0]*(n-1)
for i in range(1,n):
    ps[i] = ps[i-1] + p[i]
maxs = ps[k-1]
for i in range(1,n-k+1):
    maxs = max(maxs,ps[i+k-1]-ps[i-1])

print((maxs+k)/2)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

if n == m:
  print("Yes")
else:
  print("No")
  

Fixed submission:
N,M = map(int,input().split())
 
if N == M:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
count = 0
for i in range(N):
    flag = True
    for j in range(i):
        if P[i] > P[j]:
            flag = False
            break
    if flag: count += 1
print(count)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
count = 0
pmin = P[0]
for i in range(N):
    if pmin > P[i]: pmin = P[i]
    if pmin >= P[i]: count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(max(max(a+b,a-b),a*b)

Fixed submission:
a,b = map(int,input().split())
print(max(max(a+b,a-b),a*b))
Buggy python submission (verdict: Runtime Error):
S = input()
flag = False
for s in S:
  if flag:
    if temp = s:
      print("Bad")
      quit()
  temp = s
  flag = True
print("Good")

Fixed submission:
S = input()
flag = False
for s in S:
  if flag:
    if temp == s:
      print("Bad")
      quit()
  temp = s
  flag = True
print("Good")
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
a.sorted()
print(a[0] + a[1])

Fixed submission:
a = list(map(int,input().split()))
a.sort()
print(a[0] + a[1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
b = [0]
target = 0
count = 0
while(True):
    target = a[target] - 1
    count += 1
    if target in b:
        print("-1")
        break
    else:
        b.append(target)
    if target == 1:
        print(count)
        break


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
b = [0]
target = 0
count = 0
while(True):
    target = a[target] - 1
    count += 1
    if count > n:
        print("-1")
        break
    if target == 1:
        print(count)
        break

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
b = [0]
target = 0
count = 0
while(True):
    target = a[target] - 1
    count += 1
    if target in b:
        print("-1")
        break
    else:
        b.append(target)
    if target == 1:
        print(count)
        break

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
b = [0]
target = 0
count = 0
while(True):
    target = a[target] - 1
    count += 1
    if count > n:
        print("-1")
        break
    if target == 1:
        print(count)
        break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
answer = []

for i in range(1,n+1):
	print(a.index(i)+1, end = " ")

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

for i in range(n):
	answer[a[i]-1] = i + 1 

for i in range(n):
	print(answer[i], end = " ")
Buggy python submission (verdict: Time Limit Exceeded):
n = input()

monster = [int(x) for x in input().split()]

while(True):
	minIndex = monster.index(min(monster))
	for i in range(len(monster)): 
		if i == minIndex or monster[i] == 0:
			continue
		if monster[i] % monster[minIndex] == 0:
			monster[i] = 0
		else:
			monster[i] -= monster[minIndex] * (monster[i]//monster[minIndex])
	while(monster.count(0) > 0):
		monster.pop(monster.index(0))
	if len(monster) == 1:
		print(monster[0])
		break

Fixed submission:
n = input()

monster = [int(x) for x in input().split()]

while(True):
	minIndex = monster.index(min(monster))
	for i in range(len(monster)): 
		if i == minIndex or monster[i] == 0:
			continue
		if monster[i] % monster[minIndex] == 0:
			monster[i] = 0
		else:
			monster[i] -= monster[minIndex] * (monster[i]//monster[minIndex])
	monster = [x for x in monster if x != 0]
	if len(monster) == 1:
		print(monster[0])
		break
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = n / 2 - 1
	else:
		length = int(n / 2)
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
		array.clear()
	print(answer)

Fixed submission:
n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = int(n / 2) - 1
	else:
		length = int(n / 2)
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
		array.clear()
	print(answer)

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

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = n / 2 - 1
	else:
		length = n / 2
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
	print(answer)

Fixed submission:
n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = int(n / 2) - 1
	else:
		length = int(n / 2)
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
		array.clear()
	print(answer)

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

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = n / 2 - 1
	else:
		length = n / 2
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.apped(x)
		if len(array) == 8:
			answer += 1
	print(answer)

Fixed submission:
n = int(input())

if n < 105:
	print(0)
elif n == 105 or n == 106:
	print(1)
else:
	if n % 2 == 0:
		length = int(n / 2) - 1
	else:
		length = int(n / 2)
	array = []
	answer = 1
	for i in range(53,length+1):
		number = i * 2 + 1
		for x in range(1,n+1):
			if number % x == 0:
				array.append(x)
		if len(array) == 8:
			answer += 1
		array.clear()
	print(answer)