ZhenlongDai/ACPR huggingface dataset:
Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
nums = list(map(int,input().split(" ")))

start = 1

for num in nums:
    if num != start:
        continue
    start += 1

if start == 1:
    print(-1)
print(n-start+1)

Failing test case input:
3
2 -2 0

Expected output:
-1


Actual output:
-1
3


Fixed submission (verdict: Accepted):
n = int(input())
nums = list(map(int,input().split(" ")))

start = 1

for num in nums:
    if num != start:
        continue
    start += 1

if start == 1:
    print(-1)
else:
    print(n-start+1)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = 0
tmp = 1

for i in range(n):
  if a[i] == tmp:
    tmp += 1
  else:
    ans += 1

if ans == 0 and tmp != 0:
  print(-1)
else:
  print(ans)

Failing test case input:
1
158

Expected output:
-1


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
ans = 0
tmp = 1

for i in range(n):
  if a[i] == tmp:
    tmp += 1
  else:
    ans += 1

if ans != 0 and tmp ==1:
  print(-1)
else:
  print(ans)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

x = 1
aa = 0
for i in a:
    if i != x:
        aa += 1
    elif i == x:
        x += 1

print(aa)

Failing test case input:
3
-1 4 -3

Expected output:
-1


Actual output:
3


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

x = 1
b = 0
for i in a:
    if i != x:
        b += 1
    elif i == x:
        x += 1

if b == n:
    print(-1)
else:
    print(b)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
an = list(map(int, input().split()))
num = 1
listnum = len(an)
for a in an:
    if a == num:
        an.remove(a)
        num += 1
if listnum == len(an):
    print(-1)
else:
    print(len(an))

Failing test case input:
3
1 2 -2

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
an = list(map(int, input().split()))
num = 1
listnum = len(an)
count = 0
for a in an:
    if a == num:
        count += 1
        num += 1
notnum = len(an) - count
if listnum == notnum:
    print(-1)
else:
    print(notnum)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Num = int(input())

Str = input().split(" ")

NumList = [int(s) for s in Str]

Count = 0
Break = 1
for i in range(len(NumList)):
  if Break == NumList[i]:
    Break += 1
  else:
    Count += 1
    
print(Count)

Failing test case input:
3
-1 2 -3

Expected output:
-1


Actual output:
3


Fixed submission (verdict: Accepted):
Num = int(input())

Str = input().split(" ")

NumList = [int(s) for s in Str]

Count = 0
Break = 1
for i in range(len(NumList)):
  if Break == NumList[i]:
    Break += 1
  else:
    Count += 1

if Count == Num:
  print("-1")
else:
  print(Count)
Problem: p02832
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
cnt=1
for i in range(n):
	if a[i]==cnt:
		cnt+=1

if cnt == n+1:
	print(-1)
else:
	print(n-cnt+1)

Failing test case input:
3
5 0 -1

Expected output:
-1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
cnt=1
for i in range(n):
	if a[i]==cnt:
		cnt+=1

if cnt == 1:
	print(-1)
else:
	print(n-cnt+1)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ori = [int(i) for i in input().split()]
count = ori.count(1)
if count == 0:
    print(-1)

else:
    Break = 0
    quit  = 0
    for j in range(1,N+1):
        for i in range(Break,N):
            if ori[i] == j:
                Break = i
                
                
                
                sub = j
                break
        if i == N-1:
            break
    print(Break+1-sub)

Failing test case input:
3
1 4 -2

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
ori = [int(i) for i in input().split()]
count = ori.count(1)
if count == 0:
    print(-1)

else:
    savepoint = 0
    for j in range(1,N+1):
        for i in range(savepoint,N):
            if ori[i] == j:
                savepoint = i
                
                
                sub = j
                break
        if i == N-1:
            break
    print(N-sub)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
count = 1
ans = 0
point = 0
n = int(input())
t = list(map(int,input().split()))
for i,j in enumerate(t):
	if j == count:
		ans += i - point
		point = i + 1
		count += 1
if count == 1:
	try:
		t.index(1)
	except:
		ans = -1
print(ans)


Failing test case input:
10
3 1 5 1 19 42 2 3 0 3

Expected output:
7


Actual output:
5


Fixed submission (verdict: Accepted):
count,ans,point = 1,0,0
n = int(input())
t = list(map(int,input().split()))
for i,j in enumerate(t):
	if j == count:
		ans += i - point
		point = i + 1
		count += 1
if not point == n:
	ans += n - point
if count == 1:
	try:
		t.index(1)
	except:
		ans = -1
print(ans)

Problem: p02832
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
now_number = 0
now_count = 0

for i in range(n):
  if a[i] == now_number+1:
    now_number = a[i]
    now_count = i

if now_number == 0:
  print(-1)
else:
  print(now_count+1 - now_number)

Failing test case input:
10
3 1 5 1 19 2 2 3 0 3

Expected output:
7


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
now_number = 0

for i in range(n):
  if a[i] == now_number+1:
    now_number = a[i]

if now_number == 0:
  print(-1)
else:
  print(n - now_number)
Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
    N, *a = map(int, open(0).read().split())
    
    if 1 not in a:
        print(-1)
        exit()
    
    ans = 0
    target = 1
    i_tmp = -1
    for i, x in enumerate(a):
        if x == target:
            ans += i - i_tmp - 1
            i_tmp = i
            target += 1
    print(ans)


if __name__ == '__main__':
    solve()


Failing test case input:
10
3 1 4 1 5 9 2 6 3 3

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
def solve():
    N, *a = map(int, open(0).read().split())
    
    if 1 not in a:
        print(-1)
        exit()
    
    ans = 0
    target = 1
    i_tmp = -1
    for i, x in enumerate(a):
        if x == target:
            ans += i - i_tmp - 1
            i_tmp = i
            target += 1
    ans += N - i_tmp - 1
    print(ans)


if __name__ == '__main__':
    solve()

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))

i = 1
j = 0

if not 1 in set(a):
    print(-1)

while i in a[j:]:
    j = a[j:].index(i) + j
    
    if j >= N:
        break
    i += 1

print(N - i + 1)


Failing test case input:
3
2 -2 -1

Expected output:
-1


Actual output:
-1
3


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))

i = 1


if 1 in set(a):
    
    
    
    
    for a_i in a:
        if a_i == i:
            i += 1
    print(N - i + 1)
else:
    print(-1)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
if 1 not in a:
  print(-1)
else:
  i = 1
  j = 0
  while j != N:
    if a[j] == i:
      sum = j-i+1
      i += 1
    j += 1
  print(sum)

Failing test case input:
10
3 1 10 1 20 2 2 3 0 3

Expected output:
7


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
if 1 not in a:
  print(-1)
else:
  i = 1
  j = 0
  s = 0
  while j != N:
    if a[j] == i:
      sum = j-i+1
      i += 1
      s = j
    j += 1
  if s != N-1:
    sum += N-s-1
  print(sum)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))

position = 0
ans = 0
while True:
  if position == N:
    break
  for i in range(position,N):
    if a[i] == position + 1:
      position += 1
      ans += 1
      break
  else: 
    
    if ans == 0: 
      print("-1")
    else: 
      print(N-ans)
    exit()
print(N - ans)

Failing test case input:
10
3 1 4 1 5 9 2 6 4 3

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):


N = int(input())
a = list(map(int,input().split()))
position = 0
ans = 0
while True:
  if position >= N:
    print(-1) if ans == 0 else print(N-ans)
    break
  for i in range(position,N):
    if a[i] == ans + 1:
      
      position = i
      ans += 1
      break
  else: 
    position = N
Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from fractions import *

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
a = na()
now = 1
ct = 0
for i in range(n):
    if a[i] == now:
        now += 1
        ct += 1
print(0) if ct == 0 else print(n-ct)


Failing test case input:
1
158

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
from fractions import *

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
a = na()
now = 1
ct = 0
for i in range(n):
    if a[i] == now:
        now += 1
        ct += 1
print(-1) if ct == 0 else print(n-ct)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if a[i] == 1:
    break
  else:
    pass
else:
  print("-1")
  sys.exit()
j = 1
for i in range(n):
  if a[i] == j:
    j += 1
  else:
    pass
print(str(n-j-1))
    
       

Failing test case input:
3
1 -2 -2

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
 
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  if a[i] == 1:
    break
  else:
    pass
else:
  print("-1")
  sys.exit()
j = 1
for i in range(n):
  if a[i] == j:
    j += 1
  else:
    pass
print(str(n-j+1))

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 0
idx = 1
flg = 1
for i in a:
	if i == idx:
		idx = idx + 1
		flg = 0
	else:
		cnt = cnt + 1
		if idx != 1:
			flg = 1

if flg == 1:
	print(-1)
else:
	print(cnt)



Failing test case input:
10
3 1 10 1 20 2 2 3 -1 6

Expected output:
7


Actual output:
-1


Fixed submission (verdict: Accepted):

from sys import stdin
N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 0
idx = 1

for i in a:
	if i == idx:
		idx = idx + 1
		
	else:
		cnt = cnt + 1
		
			

if cnt == N:
	print(-1)
else:
	print(cnt)

Problem: p02832
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    b = list(map(int, input().split()))
    i = 1

    for j in range(N):
        if b[j] == i:
            i += 1
    
    print(i - 1)

if __name__ == '__main__':
    main()

Failing test case input:
3
1 2 -2

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    b = list(map(int, input().split()))
    i = 1

    for j in range(N):
        if b[j] == i:
            i += 1
    
    if i == 1:
        print(-1)
    else:
        print(N - i + 1)

if __name__ == '__main__':
    main()
Problem: p02832
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = map(int, input().split())
c = 0
start = 1
for a in A:
  if a == start:
    c+=1
    start += 1
if c == N:
  print(-1)
else:
  print(N-c)


Failing test case input:
3
2 -2 0

Expected output:
-1


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
A = map(int, input().split())
c = 0
start = 1
for a in A:
  if a == start:
    c+=1
    start += 1
if c == 0:
  print(-1)
else:
  print(N-c)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
j=1
for i in range(n):
  if a[i]==j:
    j+=1
print(n-j+1)

Failing test case input:
3
2 -1 -2

Expected output:
-1


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
j=1
for i in range(n):
  if a[i]==j:
    j+=1
if j==1:print(-1)
else:print(n-j+1)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
t = int(input())
n = [ int(i) for i in input().split(" ") ]

count = 0
num = 1

for i in range(len(n)):
  if n[i] == num:
    num += 1
  else:
    count += 1

if count == 0:
  count = -1

print(count)

Failing test case input:
3
-1 4 -3

Expected output:
-1


Actual output:
3


Fixed submission (verdict: Accepted):
t = int(input())
n = [ int(i) for i in input().split(" ") ]
 
count = 0
num = 1

for i in range(len(n)):
  if n[i] == num:
    num += 1
  else:
    count += 1

if count == t:
  count = -1

print(count)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

s = 1
count = 0
fail = 0
ans = 0
for a in A:
    if a == s:
        s += 1
        ans += count
        count = 0
    else:
        count += 1
        fail += 1

if fail == N:
    print(-1)
else:
    print(ans)

Failing test case input:
3
1 -2 -1

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

s = 1
break_count = 0
ans = 0
for a in A:
    if a == s:
        s += 1
        ans += break_count
        break_count = 0
    else:
        break_count += 1

ans += break_count

if s == 1:
    print(-1)
else:
    print(ans)

Problem: p02832
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    N = int(input())
    A = list(map(int, input().split(" ")))
    i = 1
    flag = True
    for a in A:
        if a == 1:
            flag = False
            i += 1
    if flag:
        print(-1)
    else:
        print(max(len(A) - i, 0))


if __name__ == "__main__":
    main()

Failing test case input:
3
0 1 -4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    A = list(map(int, input().split(" ")))
    i = 1
    flag = True
    for a in A:
        if a == i:
            flag = False
            i += 1
    if flag:
        print(-1)
    else:
        print(len(A) - i + 1)


if __name__ == "__main__":
    main()
Problem: p02832
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
A = [int(i) for i in input().split()]
cur = 1
broken = 0
for a in A:
    if a!=cur:
        broken += 1
    else:
        cur += 1
print(broken)

Failing test case input:
3
-1 4 -3

Expected output:
-1


Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
A = [int(i) for i in input().split()]
cur = 1
broken = 0
for a in A:
    if a!=cur:
        broken += 1
    else:
        cur += 1
if broken==N:
    print(-1)
else:
    print(broken)
Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Q = int(input())
lr = list(list(map(int,input().split())for i in range(Q)))
pn = [0,0]+[1]*(10**5-2)
O = 0
for i in range(2,317):
    for j in range(i*2,10**5,i):
        pn[j] = 0
p = pn.copy()
for i in range(7,10**5):
    if p[i]==1:
        if(pn[int((i+1)/2)]==0):
            p[i] = 0
tmp = 0
p[2] =0
for i in range(10**5):
    p[i] = tmp+p[i]
    tmp = p[i]
print(p[:30])
for l,r in lr:
    print(p[r]-p[l-1])

Failing test case input:
6
2 53
3 91
37 55
2 37
11 91
13 0

Expected output:
4
6
1
4
4
-2


Actual output:
[0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
4
6
1
4
4
-2


Fixed submission (verdict: Accepted):
Q = int(input())
lr = list(list(map(int,input().split())for i in range(Q)))
pn = [0,0]+[1]*(10**5-2)
O = 0
for i in range(2,317):
    for j in range(i*2,10**5,i):
        pn[j] = 0
p = pn.copy()
for i in range(7,10**5):
    if p[i]==1:
        if(pn[int((i+1)/2)]==0):
            p[i] = 0
tmp = 0
p[2] =0
for i in range(10**5):
    p[i] = tmp+p[i]
    tmp = p[i]
for l,r in lr:
    print(p[r]-p[l-1])

Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
q = int(input())
a = [list(int(i) for i in input().split()) for i in range(q)]
MAX = 10**5
is_prime = [1]*MAX
for i in range(2, MAX):
    if not is_prime[i]:
        continue
    for j in range(i*2, MAX, i):
        is_prime[j] = 0
s = [0]*MAX
s[2] = 1
for i in range(2,MAX-1):
    s[i+1] = s[i] + is_prime[i+1]
for i in range(q):
    l,r = a[i]
    print(s[r]-s[l])

Failing test case input:
4
13 13
2 1
7 11
91 2115

Expected output:
1
0
0
30


Actual output:
0
-1
1
295


Fixed submission (verdict: Accepted):
q = int(input())
a = [list(int(i) for i in input().split()) for i in range(q)]
MAX = 10**5
is_prime = [1]*MAX
for i in range(2, MAX):
    if not is_prime[i]:
        continue
    for j in range(i*2, MAX, i):
        is_prime[j] = 0
s = [0]*MAX
for i in range(3,MAX):
    s[i] = s[i-1] + 1 if is_prime[i] and is_prime[(i+1)
for i in range(q):
    l,r = a[i]
    print(s[r]-s[l-1])

Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
q = int(input())
a = [list(int(i) for i in input().split()) for i in range(q)]
MAX = 10**5
is_prime = [1]*MAX
for i in range(2, MAX):
    if not is_prime[i]:
        continue
    for j in range(i*2, MAX, i):
        is_prime[j] = 0
s = [0]*MAX
s[2] = 1
for i in range(2,MAX-1):
    s[i+1] = s[i] + is_prime[i+1]
for i in range(q):
    l,r = a[i]
    print(s[r]-s[l-1])

Failing test case input:
4
2 13
2 1
7 17
879 2017

Expected output:
3
0
1
16


Actual output:
6
0
4
155


Fixed submission (verdict: Accepted):
q = int(input())
a = [list(int(i) for i in input().split()) for i in range(q)]
MAX = 10**5
is_prime = [1]*MAX
for i in range(2, MAX):
    if not is_prime[i]:
        continue
    for j in range(i*2, MAX, i):
        is_prime[j] = 0
s = [0]*MAX
for i in range(3,MAX):
    s[i] = s[i-1] + 1 if is_prime[i] and is_prime[(i+1)
for i in range(q):
    l,r = a[i]
    print(s[r]-s[l-1])
Problem: p03476
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


import itertools

q = int(input())
lr_l = [[int(x) for x in input().split()] for y in range(q)]

n_max = max(itertools.chain.from_iterable(lr_l))

isp_l = [True] * (n_max+1)
isp_l[0] = False
isp_l[1] = False

for i in range(2, int(n_max ** 0.5 + 2)):
    if not isp_l[i]:
        continue
    for j in range(i * 2, n_max + 1, i):
        isp_l[j] = False

p_l = [int(x) for x in range(n_max+1) if isp_l[x]]

print(p_l)


Failing test case input:
6
1 67
3 91
37 55
19 65
11 91
13 49

Expected output:
5
6
1
2
4
2


Actual output:
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89]


Fixed submission (verdict: Accepted):


import itertools
import bisect

q = int(input())
lr_l = [[int(x) for x in input().split()] for y in range(q)]

n_max = max(itertools.chain.from_iterable(lr_l))

isp_l = [True] * (n_max+1)
isp_l[0] = False
isp_l[1] = False

for i in range(2, int(n_max ** 0.5 + 2)):
    if not isp_l[i]:
        continue
    for j in range(i * 2, n_max + 1, i):
        isp_l[j] = False

p_l = [int(x) for x in range(n_max+1) if isp_l[x]]

l_l = []
for i in range(len(p_l)):
    if (p_l[i]+1)
        l_l.append(p_l[i])

for i in range(q):
    _l,_r = lr_l[i]
    _s = bisect.bisect_left(l_l, _l)
    _e = bisect.bisect_right(l_l, _r)
    print(_e-_s)

Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
def like_2017(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
        
    for l in range(2,int(math.sqrt((n+1)/2)) + 1):
        if ((n+1)/2)%l ==0:
            return False
        
    return True

q = int(input())
L = [[int(i) for i in input().split()] for _ in range(q)]

for l,r in L:
    length = [i for i in range(l,r+1) if i % 2 == 1 and like_2017(i)]
    print(length,len(length))


Failing test case input:
6
1 53
13 91
37 109
37 51
11 67
13 49

Expected output:
4
4
3
1
3
2


Actual output:
[3, 5, 13, 37] 4
[13, 37, 61, 73] 4
[37, 61, 73] 3
[37] 1
[13, 37, 61] 3
[13, 37] 2


Fixed submission (verdict: Accepted):
import math
def like_2017(n):
    if n == 1: return False
    if n == 2: return False 

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
        
    for l in range(2,int(math.sqrt((n+1)/2)) + 1):
        if ((n+1)/2)%l ==0:
            return False
        
    return True

q = int(input())
L = [[int(i) for i in input().split()] for _ in range(q)]
ans = [0 for _ in range(10**5+1)]

for i in range(3,10**5):
    ans[i+1] = ans[i] + 1 if like_2017(i) else ans[i] 

for l,r in L:
    print(ans[r+1] - ans[l])
Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
q=[list(map(int,input().split())) for _ in range(n)]
MAX=100010
p=[1]*MAX
p[0]=0;p[1]=0
for i in range(2,MAX):
  if not p[i]:continue
  for j in range(i*2,MAX,i):p[j]=0
a=[0]*MAX
for i in range(MAX):
  if i%2==0:continue
  if p[i] and p[int((i+1)/2)]:a[i]=1
s=[0]*(MAX+1)
for i in range(MAX):
  s[i+1]=s[i]+a[i]
for i in range(n):
  print(s[q[i][1]]-s[q[i][0]])

Failing test case input:
6
2 53
5 91
37 55
2 37
11 91
13 0

Expected output:
4
5
1
4
4
-2


Actual output:
4
5
1
3
4
-2


Fixed submission (verdict: Accepted):
n=int(input())
q=[list(map(int,input().split())) for _ in range(n)]
MAX=100010
p=[1]*MAX
p[0]=0;p[1]=0
for i in range(2,MAX):
  if not p[i]:continue
  for j in range(i*2,MAX,i):p[j]=0
a=[0]*MAX
for i in range(MAX):
  if i%2==0:continue
  if p[i] and p[int((i+1)/2)]:a[i]=1
s=[0]*(MAX+1)
for i in range(MAX):
  s[i+1]=s[i]+a[i]
for i in range(n):
  print(s[q[i][1]+1]-s[q[i][0]])

Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = [True]*(100000)
num[0] = num[1] = False
for i in range(2,317):
  if num[i]:
    for j in range(i**2, 100000, i):
      num[j] = False

for i in range(int(input())):
  _input = input().split(' ')
  sum = 0
  for i in range(int(_input[0]), int(_input[1])+1):
    if (num[i-1]) and (num[(int((i+1)/2))-1]):
      sum = sum + 1
  print(sum)

Failing test case input:
6
1 53
7 119
37 55
19 51
73 39
13 17

Expected output:
4
4
1
1
-1
1


Actual output:
5
7
1
2
0
0


Fixed submission (verdict: Accepted):
num = [True]*100001
num[0] = num[1] = False
for i in range(2,317):
  if num[i]:
    for j in range(i**2, 100000, i):
      num[j] = False

c = [0]*100002
for i in range(3, 100001, 2):
  if (num[i]) and (num[int((i+1)/2)]):
    c[i] = c[i] + 1

for i in range(3, 100001):
  c[i] = c[i] + c[i-1]

for i in range(int(input())):
  _input = input().split(' ')
  print(c[int(_input[1])] - c[int(_input[0])-1])

Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
q = int(input())
    
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

ls = [0]

for i in range(1,100000):
    if is_prime(i) and is_prime((i+1)/2):
        ls.append(ls[i-1]+1)
    else:
        ls.append(ls[i-1])
        
for i in range(q):
    l,r = map(int,input().split())
    print(ls[r-1]-ls[l-1])
        

Failing test case input:
4
11 13
7 0
7 13
1181 3149

Expected output:
1
-2
1
22


Actual output:
0
670
0
22


Fixed submission (verdict: Accepted):
q = int(input())
    
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

ls = [0]

for i in range(1,100000):
    if is_prime(i) and is_prime((i+1)
        ls.append(ls[i-1]+1)
    else:
        ls.append(ls[i-1])
        
for i in range(q):
    l,r = map(int,input().split())
    if l == r:
        if is_prime(l) and is_prime((l+1)
            print(1)
        else:
          print(ls[r]-ls[l-1])  
    else:
        print(ls[r]-ls[l-1])
Problem: p03476
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
Q = int(input())
LR = [list(map(int,input().split())) for _ in range(Q)]

prime = [1]*(10**5 + 10)
for i in range(2,10**5+10):
    if prime[i]:
        for j in range(2*i,10**5 + 10,i):
            prime[j] = 0

Ans = [0]*(10**5 + 10)

for a in range(1,10**5 + 9):
    if prime[a] and prime[int((a+1)/2)]:
        Ans[a] = 1
    Ans[a] += Ans[a-1]

for l,r in LR:
    print(Ans[r]-Ans[l-1])



Failing test case input:
4
13 13
3 1
7 17
879 2017

Expected output:
1
0
1
16


Actual output:
1
-1
1
16


Fixed submission (verdict: Accepted):
Q = int(input())
LR = [list(map(int,input().split())) for _ in range(Q)]

prime = [1]*(10**5 + 10)
prime[1] = 0
for i in range(2,10**5+10):
    if prime[i]:
        for j in range(2*i,10**5 + 10,i):
            prime[j] = 0

Ans = [0]*(10**5 + 10)

for a in range(2,10**5 + 9):
    if prime[a] and prime[int((a+1)/2)]:
        Ans[a] = 1
    Ans[a] += Ans[a-1]

for l,r in LR:
    print(Ans[r]-Ans[l-1])
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

else:
    print(1)
   

Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

elif N==105:
    print(1)
else:
    print(0)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
cnt=0
if N <105:
  print(0)
else:
  if N%2==0:
    for i in range(105,N,2):
      temp=0
      for j in range(3,15,2):
        if i%j==0:
          temp+=1
      if temp==3:
        cnt+=1
  else:
    for i in range(105,N+1,2):
      temp=0
      for j in range(3,15,2):
        if i%j==0:
          temp+=1
      if temp==3:
        cnt+=1

print(cnt)

Failing test case input:
-153

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
N = int(input())
cnt=0
if N <105:
  cnt =0
else:
  if N%2==0:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+1,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1
  else:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+3,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1

print(cnt)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def test():
    n = int(input())
    count = 0
    a = []
    for i in range(1,n+1):
        if i % 2 != 0:
            for j in range(1,i+1):
                if i % j == 0:
                    count += 1
        a.append(count)
        count = 0
    print(a)
    print(a.count(8))


if __name__ == "__main__":
    test()


Failing test case input:
-153

Expected output:
0


Actual output:
[]
0


Fixed submission (verdict: Accepted):
def test():
    n = int(input())
    count = 0
    a = []
    for i in range(1,n+1):
        if i % 2 != 0:
            for j in range(1,i+1):
                if i % j == 0:
                    count += 1
        a.append(count)
        count = 0
    print(a.count(8))


if __name__ == "__main__":
    test()

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

if N < 105:
    print(0)
if N >= 105 and N < 135:
    print(1)
if N >= 135 and N < 165:
    print(2)
else:
    print(3)

Failing test case input:
-153

Expected output:
0


Actual output:
0
3


Fixed submission (verdict: Accepted):
N = int(input())

if N < 105:
    print(0)
elif N >= 105 and N < 135:
    print(1)
elif N >= 135 and N < 165:
    print(2)
elif N >= 165 and N < 189:
    print(3)
elif N >= 189 and N < 195:
    print(4)
else:
    print(5)
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n<=105:
  print(1)
  exit()

ans = 1
for i in range(107, n+1, 2):
  count = 0
  for j in range(1, i+1):
    if i % j == 0:
      count += 1
  if count == 8:
    ans += 1

print(ans)


Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
if n<105:
  print(0)
  exit()

ans = 1
for i in range(107, n+1, 2):
  count = 0
  for j in range(1, i+1):
    if i % j == 0:
      count += 1
  if count == 8:
    ans += 1

print(ans)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n == 105:
    print(1)
elif n in range(1, 135):
    print(0)
elif n in range(135, 165):
    print(2)
elif n in range(165, 189):
    print(2)
elif n in range(189, 195):
    print(3)
else:
    print(4)




Failing test case input:
-153

Expected output:
0


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
if n < 105:
    print(0)
elif n in range(105, 135):
    print(1)
elif n in range(135, 165):
    print(2)
elif n in range(165, 189):
    print(3)
elif n in range(189, 195):
    print(4)
else:
    print(5)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
lst = [135, 189, 105, 165, 195]
tmp = 0

for i in range(5):
    if n<=lst[i]:
        tmp += 1

print(tmp)

Failing test case input:
-153

Expected output:
0


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
lst = [135, 189, 105, 165, 195]
tmp = 0
x = []

for i in range(5):
    x.append(n-lst[i])

for i in range(5):
    if x[i]>=0:
        tmp += 1

print(tmp)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

count=0
ans=0
if n<=104:
    print('0')
else:
    for i in range(105,n+1):
        count=0
        for e in range(1,n+1):
            if i%2==0:
                break
            elif i%e==0:
                count+=1
        if count==8:
            ans+=1
print(ans)

Failing test case input:
-153

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
n=int(input())

count=0
ans=0
if n<=104:
    ans=0
else:
    for i in range(105,n+1):
        count=0
        for e in range(1,n+1):
            if i%2==0:
                break
            elif i%e==0:
                count+=1
        if count==8:
            ans+=1
print(ans)
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)
divisors_8.remove(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


N = int(input())
N_MAX = 200
prime = [1 for i in range(N_MAX+1)]
prime[0], prime[1] = 0, 0
for i in range(2, N_MAX+1):
    if prime[i] == 1:
        for j in range(2*i, N_MAX+1, i):
            prime[j] = 0
ps = []
prime[2] = 0
for i in range(N_MAX+1):
    if prime[i] == 1:
        ps.append(i)
print(ps)
pl = len(ps)
ans = 0
for i in range(pl):
    for j in range(i+1, pl):
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                
                ans += 1
print(ans)

Failing test case input:
-153

Expected output:
0


Actual output:
[3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]
0


Fixed submission (verdict: Accepted):


N = int(input())
N_MAX = 200
prime = [1 for i in range(N_MAX+1)]
prime[0], prime[1] = 0, 0
for i in range(2, N_MAX+1):
    if prime[i] == 1:
        for j in range(2*i, N_MAX+1, i):
            prime[j] = 0
prime[2] = 0
ps = []
for i in range(N_MAX+1):
    if prime[i] == 1:
        ps.append(i)
pl = len(ps)
ans = 0
for i in range(pl):
    for j in range(i+1, pl):
        if (ps[i]**3)*ps[j] <= N or ps[i]*(ps[j]**3) <= N:
            ans += 1
        for k in range(j+1, pl):
            if ps[i]*ps[j]*ps[k] <= N:
                ans += 1
print(ans)

Problem: p03281
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
if N<=105:
    print(1)
else:
    ans=0
    for n in range(106,N+1):
        K=n
        y=0
        for k in range(2,K):
            if n%k==0:
                y+=1
        if y==6:
            ans+=1
    print(ans)

Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
if N<105:
    print(0)
elif N==105:
    print(1)
else:
    ans=1
    for n in range(106,N+1):
        if n%2:
            K=n
            y=0
            
            for k in range(2,K+1):
                if n%k==0:
                    y+=1
                    
            if y==6:
                
                ans+=1
    print(ans)
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if n<104:
  print(0)
if n<135:
  print(1)
if n<165:
  print(2)
if n<189:
  print(3)
if n<195:
  print(4)

Failing test case input:
-153

Expected output:
0


Actual output:
0
1
2
3
4


Fixed submission (verdict: Accepted):
n=int(input())
if n<105:
  print(0)
elif n<135:
  print(1)
elif n<165:
  print(2)
elif n<189:
  print(3)
elif n<195:
  print(4)
else:
  print(5)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


def solve(n):
    listc = []
    for i in range(1,201):
        lista = []
        for j in range(1,201):
            if i%j == 0:
                lista.append(j)
        if len(lista) >= 8 and lista[-1] %2 != 0:
            listc.append(lista[-1])
    
    for i in range(len(listc)):
        if n >= listc[-(i+1)]:
            return len(listc)-i
solve(200)


def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

Failing test case input:
-153

Expected output:
0


Actual output:
None


Fixed submission (verdict: Accepted):
import sys


def solve(n):
    listc = []
    for i in range(1,201):
        lista = []
        for j in range(1,201):
            if i%j == 0:
                lista.append(j)
        if len(lista) >= 8 and lista[-1] %2 != 0:
            listc.append(lista[-1])
    
    for i in range(len(listc)):
        if n < listc[0]:
            return 0
        elif n >= listc[-(i+1)]:
            return len(listc)-i


def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = 0
for i in range(1, 200, 2):
  cnt = 0
  for j in range(1, i + 1):
    if i % j == 0:
      cnt += 1
  print(j)
  if cnt == 8:
    ans += 1
print(ans)

Failing test case input:
-153

Expected output:
0


Actual output:
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177
179
181
183
185
187
189
191
193
195
197
199
5


Fixed submission (verdict: Accepted):
N = int(input())
ans = 0
for i in range(1, N + 1, 2):
  cnt = 0
  for j in range(1, i + 1):
    if i % j == 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(1+cnt_all)

else:
    print(1)

Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
cnt_all = 0

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

elif N==105:
    print(1)
else:
    print(0)

Problem: p03281
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=input("n=")

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)

Failing test case input:
-153

Expected output:
0


Actual output:
n=0


Fixed submission (verdict: Accepted):
n=input()

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i+1):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = 0
if N<105:
  print(0)
else:
  for i in range(105,N+1,2):
    cnt = 0
    for j in range(1,N+1,2):
      if i%j == 0:
        cnt += 1
        if cnt == 8:
          ans += 1
print(ans)

  

Failing test case input:
-153

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
N = int(input())
ans = 0
if N<105:
  ans = 0
else:
  for i in range(105,N+1,2):
    cnt = 0
    for j in range(1,N+1,2):
      if i%j == 0:
        cnt += 1
        if cnt == 8:
          ans += 1
print(ans)

Problem: p03281
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

 
import math
import itertools
import sys
import copy
 




N = int(input())

if N <= 105 :
  print (1)
  exit()

cnt = 1
for i in range(107, N+1, 2) :
  q = 0
  for j in range(1, i+1) :
    if i%j == 0 :
      q += 1
  if q == 8 :
    cnt += 1
print (cnt)


Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):

 
import math
import itertools
import sys
import copy
 




N = int(input())

if N == 105 :
  print (1)
  exit()
elif N < 105 :
  print (0)
  exit()
  
cnt = 1
for i in range(107, N+1, 2) :
  q = 0
  for j in range(1, i+1) :
    if i%j == 0 :
      q += 1
      
  if q == 8 :
    cnt += 1
    
print (cnt)
Problem: p03281
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
ans=0
n=int(input())
if n<105:
  print('0')
else:
  for i in range(105,n+1):
    if i%2!=0:
      cnt=0
      for j in range(1,i+1):
        if i%j==0:
          cnt+=1
      if cnt==8:
         ans+=1

print(ans)


Failing test case input:
-153

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
ans=0
n=int(input())
if n<105:
  print('0')
  exit()
else:
  for i in range(105,n+1):
    if i%2!=0:
      cnt=0
      for j in range(1,i+1):
        if i%j==0:
          cnt+=1
      if cnt==8:
         ans+=1

print(ans)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
p=[3,5,7,11,13]
x=[]
for i in range(5):
	for j in range(i):
		for k in range(j):
			if n >= p[i]*p[j]*p[k]:
				x.append(i*j*k)
cnt=len(x)
if  135 <= n <189:
	cnt += 1
elif   n  <= 189:
	cnt += 2
else:
	pass
print(cnt)

Failing test case input:
-153

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
p=[3,5,7,11,13]
x=[]
for i in range(5):
	for j in range(i):
		for k in range(j):
			if n >= p[i]*p[j]*p[k]:
				x.append(i*j*k)
cnt=len(x)
if 135 <= n < 189:
	cnt += 1
elif 189 <= n:
	cnt += 2
else:
	pass
print(cnt)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

cnt_2 = 0
if n < 105:
    print(0)

else:
    for i in range(105,n+1,2):
        cnt = 0
        for j in range(1,i+1):
            if i % j == 0:
                cnt += 1
        if cnt == 8:
            cnt_2 += 1

print(cnt_2)

Failing test case input:
-153

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
n = int(input())
 
cnt_2 = 0
if n < 105:
    print(0)
else:
    for i in range(105,n+1,2):
        cnt = 0
        for j in range(1,i+1):
            if i % j == 0:
                cnt += 1
        if cnt == 8:
            cnt_2 += 1
    print(cnt_2)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if 104<n<135:
  print(1)
elif 134<n<165:
  print(2)
elif 164<n<189:
  print(3)
elif 188<n<195:
  print(4)
else:
  print(5)

Failing test case input:
-153

Expected output:
0


Actual output:
5


Fixed submission (verdict: Accepted):
n=int(input())
if n<105:
  print(0)
elif 104<n<135:
  print(1)
elif 134<n<165:
  print(2)
elif 164<n<189:
  print(3)
elif 188<n<195:
  print(4)
else:
  print(5)
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
odd = []
odd_divs = []

for i in range(1, n + 1):
    if i % 2 == 1:
        odd.append(i)
        
print(odd)
for i in range(len(odd)):
    count = 0
    for j in range(1, odd[i] + 1):
        if odd[i] % j == 0:
            count += 1            
    odd_divs.append(count)
    
print(odd_divs.count(8))

Failing test case input:
-153

Expected output:
0


Actual output:
[]
0


Fixed submission (verdict: Accepted):

n = int(input())
odd = []
odd_divs = []

for i in range(1, n + 1):
    if i % 2 == 1:
        odd.append(i)
        
for i in range(len(odd)):
    count = 0
    for j in range(1, odd[i] + 1):
        if odd[i] % j == 0:
            count += 1            
    odd_divs.append(count)
    
print(odd_divs.count(8))

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N =int(input())
cnt =1
temp = 0
if N <105:
  print(0)
else:
  if N%2 ==0:
    n = N+1
    for i in range(107,n,2):
      temp=0
      for j in range(3,15,2):
        if i%j==0:
          temp+=1
      if temp==3:
        cnt+=1
  else:
    n = N+2 
    for i in range(107,n,2):
      temp=0
      for j in range(3,15,2):
        if i%j==0:
          temp+=1
      if temp==3:
        cnt+=1
print(cnt)

Failing test case input:
-153

Expected output:
0


Actual output:
0
1


Fixed submission (verdict: Accepted):
N = int(input())
cnt=0
if N <105:
  cnt =0
else:
  if N%2==0:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+1,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1
  else:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+3,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1

print(cnt)

Problem: p03281
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
count = 0
for i in range(1,n+1):
  if n % i == 0:
    count += 1
if count == 8:
  print("Yes")
else:
  print("No")

Failing test case input:
-153

Expected output:
0


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
count = 0
for i in range(1,n+1,2):
  ans = 0
  for j in range(1,n+1):
    if i % j == 0:
      ans += 1
  if ans == 8:
    count += 1
print(count)

Problem: p03281
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
b = 0
for i in range(1, n+1):
  if i % 2 == 1:
    a = 0
    for j in range(1, i+1):
      if i % j == 0:
        a += 1
    if a == 8:
      b += 1

Failing test case input:
-153

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
b = 0
for i in range(1, n+1):
  if i % 2 == 1:
    a = 0
    for j in range(1, i+1):
      if i % j == 0:
        a += 1
    if a == 8:
      b += 1
print(b)
Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

def cnt(x):
	return sum(1 for i in range(1, x+1) if x%i == 0)

sum(1 for i in range(1, n+1, 2) if cnt(i) == 8)

Failing test case input:
-153

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
def cnt(x):
	return sum(1 for i in range(1, x+1) if x%i == 0)
print(sum(1 for i in range(1, n+1, 2) if cnt(i) == 8))

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = 0
if N<105:
  print(0)
elif N == 105:
  ans += 1
else:
  for i in range(105,N,2):
    cnt = 0
    for j in range(1,N,2):
      if i%j == 0:
        cnt += 1
        if cnt == 8:
          ans += 1
print(ans)


Failing test case input:
-153

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
N = int(input())
ans = 0
if N<105:
  ans = 0
else:
  for i in range(105,N+1,2):
    cnt = 0
    for j in range(1,N+1,2):
      if i%j == 0:
        cnt += 1
        if cnt == 8:
          ans += 1
print(ans)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def yaku(n):
    cnt = 0
    for i in range(1, n + 1):
        if n % i == 0:
            cnt += 1
    return cnt


n = int(input())
print(sum(1 for i in range(1, 200 + 1) if yaku(i) == 18))


Failing test case input:
-153

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
def yaku(n):
    cnt = 0
    for i in range(1, n + 1):
        if n % i == 0:
            cnt += 1
    return cnt


n = int(input())
print(sum(1 for i in range(1, n + 1, 2) if yaku(i) == 8))

Problem: p03281
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=input("n=")

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i+1):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)

Failing test case input:
-153

Expected output:
0


Actual output:
n=0


Fixed submission (verdict: Accepted):
n=input()

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i+1):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)

Problem: p03281
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
count=1
if N<105:
    print(0)
else:
    for i in range(107,N+1,2):
        if i%2==1:
            c=0
            for j in range(1,i+1,2):
                if i%j==0:
                    c+=1
            if c==8:
                count+=1
print(count)

Failing test case input:
-153

Expected output:
0


Actual output:
0
1


Fixed submission (verdict: Accepted):
N=int(input())
count=1
if N<105:
    print(0)
else:
    for i in range(107,N+1,2):
        if i%2==1:
            c=0
            for j in range(1,i+1,2):
                if i%j==0:
                    c+=1
            if c==8:
                count+=1
    print(count)