Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02608 (python)

Fixed submission:
import itertools
ln = itertools.product(range(1,100),repeat = 3)
#print(ln)
line = [0 for i in range(10000)]
#print(len(line))
for i in ln:
    x,y,z = i
    n = x**2 +y**2 + z**2 +x*y + y*z + z*x
    if n <=10000:
        line[n-1]+=1
N = int(input())
for i in range(N):
    print(line[i])

Buggy submission (verdict: Runtime Error):
import itertools
ln = itertools.product(range(1,31),repeat = 3)
#print(ln)
line = [0 for i in range(1000)]
#print(len(line))
for i in ln:
    x,y,z = i
    n = x**2 +y**2 + z**2 +x*y + y*z + z*x
    if n <=1000:
        line[n-1]+=1
N = int(input())
for i in range(N):
    print(line[i])

Buggy submission (verdict: Runtime Error):
import itertools
ln = itertools.product(range(1,31),repeat = 3)
#print(ln)
line = [0 for i in range(1000)]
print(len(line))
for i in ln:
    x,y,z = i
    n = x**2 +y**2 + z**2 +x*y + y*z + z*x
    if n <=1000:
        line[n-1]+=1
N = int(input())
for i in range(N):
    print(line[i])
Problem p02683 (python)

Fixed submission:
#167
#c
import sys
import itertools
import numpy
n,m,x  = map(int, input().split())
zentan = itertools.product([0,1],repeat = n)
condi  = []
for i in range(n):
    ln = list(map(int, input().split()))
    condi.append(ln)
min_cost = 10**10
for i in zentan:# e.g.   i = (0,0, ...) len(i ) = n
    cost = 0
    skills= [0]*m
    # cost 
    for n1, n2 in enumerate(i):# n1 = 0~n-1, n2 = i[n1]
        cost += condi[n1][0]*n2
        #skills
        for n3 in range(m): # n3 = 0~m-1
            skills[n3] += condi[n1][n3+1]*n2
    if min(skills) >= x and cost < min_cost:
        min_cost = cost
    
        

            
            
if min_cost<10**10:
    print(min_cost)
else:
    print('-1')

Buggy submission (verdict: Runtime Error):
#167
#c
import sys
import itertools
import numpy
n,m,x  = map(int, input().split())
zentan = itertools.product([0,1],repeat = m)
condi  = []
for i in range(n):
    ln = list(map(int, input().split()))
    condi.append(ln)
cost_min = 10**10
for i in zentan:
    cost = 0
    skills= [0]*m
    
    for k,j in enumerate(i): # zentan i 
      cost += condi[k][0]*j
      for c in range(1,m +1):
        skills[c-1]+= condi[k][c]*j
    
    if min(skills) >= x:
        cost_min = min(cost,cost_min)

if cost_min<10**10:
    print(cost_min)
else:
    print('-1')
Problem p02696 (python)

Fixed submission:
#abc 165
# d
a,b,n = map(int,input().split())
nmax = 0

# for i in range(0,min(b,n+1)):
#     ni = int(a*i/b)
#     if ni > nmax:
#         nmax = ni
# print(nmax)

q = min(b-1,n)
ni = int(a*q/b)
if ni > nmax:
        nmax = ni
print(nmax)

Buggy submission (verdict: Runtime Error):
q = min(b-1,n)
ni = int(a*q/b)
if ni > nmax:
        nmax = ni
print(nmax)
Problem p02717 (python)

Fixed submission:
#abc 161a
a,b,c = map(int, input().split())
# abc -> bac -> cab
print(str(c)+' '+str(a)+' '+str(b))

Buggy submission (verdict: Runtime Error):
#abc 161c
import math
n,k = map(int, input().split())
i = int(n/k)
ilow = i
iup = i+1
print(min(n,abs(n-k*iup),n-k*ilow))
Problem p02844 (python)

Fixed submission:
n = int(input())
s = input()
import itertools
state = itertools.product(list(range(10)),repeat = 3)
#print(list(state))
def lucky_pin(i):
    spot = -1
    for j in i:
        
        if str(j) in s[spot +1 : ]:
            spot = s[spot +1 : ].find(str(j)) +spot +1
            
        else:
            return 0
    return 1
      
counter = 0
for i in state:
    counter += lucky_pin(i)
        
print(counter)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
import itertools
state = itertools.product(list(range(10)),repeat = 3)
#print(list(state))
def lucky_pin(i):
    spot = -1
    for j in i:
        
        if str(j) in s[spot +1 : ]:
            spot = s[spot +1 : ].find(str(j)) +spot +1
            
        else:
            return 0
    return 1
print(lucky_pin(i))        
counter = 0
for i in state:
    if 1 ==  lucky_pin(i):
        
        counter +=1
print(counter)
Problem p03106 (python)

Fixed submission:
A,B, K = map(int, input().split())
def divisor(n):
    div_list = []
    for i in range(1, int(1+ n**0.5)):
        if n%i == 0 and i**2 == n:
            div_list.append(i)
        elif n%i == 0:
            div_list.append(i)
            div_list.append(int(n/i))
    return div_list
lnA = divisor(A)
lnB = divisor(B)
ln = []
for i in lnA:
    if i in lnB:
        ln.append(i)
line = sorted(ln, reverse = True)
print(line[K - 1])

Buggy submission (verdict: Runtime Error):
A,B, K = map(int, input().split())
lnA = divisor(A)
lnB = divisor(B)
ln = []
for i in lnA:
    if i in lnB:
        ln.append(i)
line = sorted(ln, reverse = True)
print(line[K - 1])
Problem p04044 (python)

Fixed submission:
line  =input().split(' ')
ln = []
for i in range(int(line[0])):
    ln.append(input())
outline= ''
for i in sorted(ln):
    outline += i
print (outline)

Buggy submission (verdict: Runtime Error):
n,l  = list(map(int, input().split()))
ln = []
for n in range(l):
    ln.append(input())
output = ''
for i in sorted(ln):
    output += i
print(output)
Problem p02658 (python)

Fixed submission:
def main():
	n = int(input())
	list1 = [int(t) for t in input().split()]
	list1.sort()
	ans = 1
	b = 0
	for i in range (0, n):
		ans = ans * list1[i]
		if int(ans) > int(1000000000000000000):
			print(-1)
			return
	print(ans)
	return

if __name__ == "__main__":
  #Run as main program
  main()

Buggy submission (verdict: Runtime Error):
def main():
	list = []
	n = int(input())
	for i in range (0,n):
		ele = int(input())
		list.append(ele)
	list.sort()
	ans = int(1)
	b = 0
	for i in range (0, n):
		ans = ans * list[i]
		if int(ans) > int(1000000000000000000):
			print(-1)
			return
	print(ans)
	return

if __name__ == "__main__":
  #Run as main program
  main()
Problem p02642 (python)

Fixed submission:
import numpy as np

length = int(input())
As = list(map(int, input().split()))

As.sort()

# indexを数値と紐づけるために+1増やした数にする
check = np.zeros(10**6+1)

answer = 0

# 与えられた数列の小さいものから順にループ
for i in range(length):
    if check[As[i]] == 0:
        # 与えられた数値の倍数すべてに1を立てる
        # checkは0始まりのため、0と倍数要素に1が立つ
        check[::As[i]] = 1
        
        # checkリストが0の状態で数列の最後であればanswerへの加算は確定
        # また、同じ数字が複数ある場合はカウントさせない
        if  i == (length - 1) or  As[i] != As[i + 1]:
                answer = answer + 1

print(answer)

Buggy submission (verdict: Runtime Error):
import numpy as np

length = int(input())
As = list(map(int, input().split()))

As.sort()

# indexを数値と紐づけるために+1増やした数にする
check = np.zeros(10**6+1)

answer = 0

# 与えられた数列の小さいものから順にループ
for i in range(length):
    if check[As[i]] == 0:
        # 与えられた数値の倍数すべてに1を立てる
        # checkは0始まりのため、0と倍数要素に1が立つ
        check[::As[i]] = 1
        
        # 同じ数字が複数ある場合はカウントさせない
        if As[i] != As[i + 1]:
            answer = answer + 1

print(answer)
Problem p02658 (python)

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

if A.count(0) >= 1:
    print(0)
    exit()

answer = 1
for _ in A:
    answer *= _
    if answer > 1000000000000000000:
        print('-1') 
        exit()

print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = 1
for _ in range(N):
    A = A * int(input())

print(A)
Problem p02607 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
c=0
cc=0
for i in a:
  c+=1
  if c%2==0:
    continue
  if i%2!=0:
    cc+=1
print(cc)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
c=0
cc=0
for i in a:
   c+=1
    if c%2==0:
      continue
    if i%2!=0:
      cc+=1
print(cc)
Problem p02646 (python)

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

if a<b:
    if b+w*t <= a+v*t:
      print('YES')
    else:
      print('NO')
else:
    if a-v*t <=	b-w*t:
      print('YES')
    else:
      print('NO')

Buggy submission (verdict: Runtime Error):
a,v = map(float,input().split())
b,w = map(float,input().split())
t = float(input())

if a<b:
    if b+w*t <= a+v*t:
        print('YES')
    else:
        print('NO')
else:
    if a-v*t <=	b-w*t:
		print('YES')
    else:
		print('NO')

Buggy submission (verdict: Runtime Error):
a,v = map(float,input().split())
b,w = map(float,input().split())
t = float(input())

if a<b:
    if b+w*t <= a+v*t:
        print('YES')
    else:
        print('NO')
else:
    if a-v*t <=	b-w*t:
	print('YES')
    else:
	print('NO')
Problem p02690 (python)

Fixed submission:
x = int(input())
a = []
for i in range(1000):
    a.append(i**5)

for i in range(999):
    for j in range(i+1,1000):
        if a[i]-a[j]==x:
            A=i
            B=j
            break
        elif -a[i]-a[j]==x:
            A=-i
            B=j
            break
        elif -a[i]+a[j]==x:
            A=-i
            B=-j
            break
        elif a[i]+a[j]==x:
            A=i
            B=-j
            break
print('%d %d'%(A,B))

Buggy submission (verdict: Runtime Error):
x = int(input())
a = []
for i in range(80):
    a.append(i**5)

for i in range(79):
    for j in range(i+1,80):
        if a[i]-a[j]==x:
            A=i
            B=j
            break
        elif -a[i]-a[j]==x:
            A=-i
            B=j
            break
        elif -a[i]+a[j]==x:
            A=-i
            B=-j
            break
        elif a[i]+a[j]==x:
            A=i
            B=-j
            break
print('%d %d'%(A,B))
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
a=0
b=0
if m==0:
    print(0,0)
    exit()
p = [[str(i) for i in input().split()] for _ in range(m)]

c = sorted(p,key=lambda x:x[0])

now = c[0][0]
d = 1
aa=0
bb=0
f = 0

for i in c:
    if i[0] == now:
        if i[1]=='AC':
            if d:
                a += 1
                f = 1
                d = 0
        else:
            if not f:
                bb+=1
    else:
        now = i[0]
        d = 1
        if f:
            b += bb
            f = 0
        bb = 0
        if i[1]=='AC':
            if d:
                a+=1
                f=1
                d = 0
        else:
            if not f:
                bb+=1
if f:
  b+=bb
print(a,b)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a=0
b=0
if m==0:
    print(0,0)
    exit()
p = [[str(i) for i in input().split()] for _ in range(m)]

c = sorted(p,key=lambda x:x[0])

now = c[0][0]
d = 1
aa=0
bb=0
f = 0

for i in c:
    if i[0] == now:
        if i[1]=='AC':
            if d:
                a += 1
                f = 1
                d = 0
        else:
            if not f:
                bb+=1
    else:
        now = i[0]
        d = 1
        if f:
            b += bb
            f = 0
            bb = 0
        if i[1]=='AC':
            if d:
                a+=1
                f=1
                d = 0
        else:
            if not f:
                bb+=1
    else:
        now = i[0]
        d = 1
	if f:
            b += bb
            f = 0
            bb = 0
        if i[1]=='AC':
            if d:
                a+=1
                f=1
                d = 0
        else:
            if not f:
                bb+=1
b += bb
print(a,b)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a=0
b=0
if m==0:
    print(0,0)
    exit()
p = [[str(i) for i in input().split()] for _ in range(m)]

c = sorted(p,key=lambda x:x[0])

now = c[0][0]
d = 1
aa=0
bb=0
f = 0
print(now)
for i in c:
    if i[0] == now:
        if i[1]=='AC':
            if d:
                a += 1
                f = 1
                d = 0
        else:
            if not f:
                bb+=1
    else:
        now = i[0]
        d = 1
        if f:
            b += bb
            f = 0
            bb = 0
        if i[1]=='AC':
            if d:
                a+=1
                f=1
                d = 0
        else:
            if not f:
                bb+=1
    else:
        now = i[0]
        d = 1
	if f:
            b += bb
            f = 0
            bb = 0
        if i[1]=='AC':
            if d:
                a+=1
                f=1
                d = 0
        else:
            if not f:
                bb+=1
b += bb
print(a,b)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
max = -1
move = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        move += 1
    else:
        if max < move:
            max = move
        move = 0
if max < move:
    print(move)
else:
    print(max)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
tap = 0
num = 1
if b == 1:
    print(tap)
    exit()
tap += 1

while True:
    num = num + a - 1
    if b <= num:
        break
    else:
        tap += 1

print(tap)
Problem p02924 (python)

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

Buggy submission (verdict: Runtime Error):
    n = int(input())
    count = (n-1)*n//2
    print(count)
Problem p03109 (python)

Fixed submission:
S = input()

if S <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
S = input()

if S <= '2019/04/30':
  print('Heisei')
else:
  print(TBD)
Problem p03448 (python)

Fixed submission:
a = int(input())  # 500
b = int(input())  # 100
c = int(input())  # 50
x = int(input())  # objecive

counter = 0
for use_a in range(a + 1):
    if 500 * use_a > x:
        continue
    rest = x - 500 * use_a
    for use_b in range(b + 1):
        if 100 * use_b > rest:
            continue
        rest_c = rest - 100 * use_b
        for use_c in range(c + 1):
            if 50 * use_c != rest_c:
                continue
            counter += 1

print(counter)

Buggy submission (verdict: Runtime Error):
a = input() # 500
b = input() # 100
c = input() # 50
x = input() # objecive

counter = 0
for use_a in range(a+1):
  if 500*use_a > x:
    continue
  rest = x - 500*use_a
  for use_b in range(b+1):
    if 100*use_b > rest:
      continue
    rest = rest - 100*use_b
    for use_c in range(c+1):
      if 50*use_c != rest:
        continue
      counter += 1

print(counter)
Problem p03485 (python)

Fixed submission:
import numpy as np
ab = input().split(" ")
print(int(np.ceil(np.mean([int(ab[0]), int(ab[1])]))))

Buggy submission (verdict: Runtime Error):
import numpy as np
ab = input().split(" ")
print(np.round(np.mean(int(ab[0]), int(ab[1]))))
Problem p03493 (python)

Fixed submission:
in_str = input()
count = 0
for ch in in_str:
  if ch == "1":
    count += 1
print(count)

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

ans=0
while all(i%2==0 for i in a):
    ans+=1
    for j in range(n):
        a[j]//=2
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
a_list = input().split(" ")

def count_divide(number, max_cnt=-1):
  count = 0
  mod = -1
  while mod != 1:
    q, mod = divmod(number, 2)
    if mod == 1:
      return count
    count += 1
    if max_cnt != -1 and count >= max_cnt:
      return max_cnt
    number = q
  return count

result = -1
for a in a_list:
  result = count_divide(int(a), result)
print(result)

Buggy submission (verdict: Runtime Error):
n = input()
a_list = input().split(" ")

def count_divide(number, max_cnt=-1):
  count = 0
  mod = -1
  while mod != 1:
    q, mod = divmod(number, 2)
    if mod == 1:
      return count
    count += 1
    if max_cnt != -1 and count >= max_cnt:
      return max_cnt
    number = q
  return count

result = -1
for a in a_list:
  result = count_divide(int(a), result)
print(result)

Buggy submission (verdict: Runtime Error):
n = input()
a_list = input().split(" ")

def count_divide(number, max_cnt=0):
  count = 0
  mod = -1
  while mod != 1:
    q, mod = divmod(number, 2)
    if mod == 1:
      return count
    count += 1
    if max_cnt != 0 and count >= max_cnt:
      return max_cnt
    number = q
  return count

result = 0
for a in a_list:
  result = count_divide(int(a), result)
print(result)
Problem p03494 (python)

Fixed submission:
n = input()
nums = [int(i) for i in input().split(" ")]

def is_even(num_list):
  for num in num_list:
    if num % 2 != 0:
      return False
  return True

counter = 0
while(is_even(nums)):
  counter += 1
  nums = [n/2 for n in nums]
print(counter)

Buggy submission (verdict: Runtime Error):
n = input()
a_list = input().split(" ")

def count_divide(number, max_cnt=-1):
  count = 0
  mod = -1
  while mod != 0:
    q, mod = divmod(number)
    count += 1
    if max_cnt != -1 & count >= max_cnt:
      return max_cnt
  return count

result = -1
for a in a_list:
  result = count_divide(int(a), result)
print(result)
Problem p02641 (python)

Fixed submission:
x,n = map(int, input().split())
p = list(map(int, input().split()))
ab = min(abs(101 - x),abs(x))
if abs(101 - x) >= abs(x):
    answer = 0
else:
    answer = 101
for i in range(1,101):
    if i in p:
        continue
    else:
        if ab > abs(x - i):
            ab = abs(x - i)
            answer = i
        elif ab == abs(x-i) and answer > i:
            answer = i
print(answer)

Buggy submission (verdict: Runtime Error):
x,n = map(int, input().split())
p = list(map(int, input().split()))
ab = min(abs(101 - x),abs(x+1))
for i in range(1,101):
    if i in p:
        continue
    else:
        if ab > abs(x - i):
            ab = abs(x - i)
            answer = i
print(answer)
Problem p02664 (python)

Fixed submission:
t = input()
t = t.replace('?','D')
print(t)

Buggy submission (verdict: Runtime Error):
t = input()
for i in t:
    if i == '?':
        t[i] = 'D'

print(t)
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()
count = 0
for i in range(n-2):
    if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
count = 0
for i in range(n):
    if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
count = 0
for i in range(n):
    if s[i] == 'A' and s[i + 1] == 'B' and s[i + 2] == 'C':
        count += 1

print(count)
Problem p02928 (python)

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

one_tento = 0
for i in range(n-1):
    for j in range(i+1,n):
        if array[i] > array[j]:
            one_tento += 1
one_tento = int(one_tento)

two_tento = 0
for i in range(n):
    for j in range(n):
        if array[i] > array[j]:
            two_tento += 1
two_tento = int(two_tento)

result1 = (one_tento * k) % (7 + 10**9)
result2 = ((two_tento % (7 + 10**9)) * ((k * (k - 1) // 2) % (7 + 10**9))) % (7 + 10 **9)
result3 = (result1 + result2) % (7 + 10**9)
print(int(result3))

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
array = list(map(int, input().split()))
one_tento:int = 0
for i in range(n-1):
    for j in range(i+1,n):
        if array[i] > array[j]:
            one_tento += 1
two_tento:int = 0
for i in range(n):
    for j in range(n):
        if array[i] > array[j]:
            two_tento += 1

result1:int = (one_tento * k) % (7 + 10**9)
result2:int = (two_tento * k * (k - 1) / 2) % (7 + 10**9)
result3:int = (result1 + result2) % (7 + 10**9)
print(int(result3))

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
array = list(map(int, input().split()))
one_tento:int = 0
for i in range(n-1):
    for j in range(i+1,n):
        if array[i] > array[j]:
            one_tento += 1
two_tento:int = 0
for i in range(n):
    for j in range(n):
        if array[i] > array[j]:
            two_tento += 1

result1:int = (one_tento * k) % (7 + 10**9)
result2:int = (two_tento * k * (k - 1) / 2) % (7 + 10**9)
result3:int = (result1 + result2)% (7 + 10**9)
print(int(result3))

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
array = list(map(int, input().split()))

one_tento:int = 0 # Aの転倒数を求める
for i in range(n-1):
    for j in range(i+1,n):
        if array[i] > array[j]:
            one_tento += 1
two_tento:int = 0 # ２つのAの転倒数を求める
for i in range(n):
    for j in range(n):
        if array[i] > array[j]:
            two_tento += 1

result1:int = (one_tento * k) % (7 + 10**9)
result2:int = (two_tento * k * (k - 1) / 2) % (7 + 10**9)
#print('本来のただしい答えは、{}'.format(int(result1 % (7 + 10 ** 9))))
#print('公式に当てはめた答えは{}'.format(int(result2 % (7 + 10 ** 9))))
result3:int = (result1 + result2)% (7 + 10**9)
print(int(result3))
Problem p02606 (python)

Fixed submission:
a = list(map(int,input().split()))
counter = 0

for i in range(a[0],a[1]+1):
    if i % a[2] == 0:
        counter += 1
print(counter)

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

for i in range(a[0,a[1]+1]):
    if i % a[2] == 0:
        counter += 1
print(counter)
Problem p02641 (python)

Fixed submission:
X,N = map(int,input().split())
p = [int(i) for i in input().split()]
if N==0:
    print(X)
else:
    pN=[]
    for j in range(N):
        pj = p[j]-X
        pN.append(pj)
    pN.sort()
    p0 = pN[0]-1
    p1 = pN[N-1]+1
    list_p = list(range(p0,p1+1,1))
    result = list(set(list_p)-set(pN))
    k0 = abs(result[0])
    for k in result:
        k1 = abs(k)
        if k1<k0:
            k0 = k1
    cnt = 0
    for l in result:
        if l == (-1)*k0:
            cnt+=1
    if cnt==0:
        print(X+k0)
    else:
        print(X-k0)

Buggy submission (verdict: Runtime Error):
X,N = map(int,input().split())
p = [int(i) for i in input().split()]
if N==0:
    print(X)
else:
    pN=[]
    for j in range(N):
        pj = p[j]-X
        pN.append(pj)
    pN.sort()
    p0 = pN[0]-1
    p1 = pN[N-1]+1
    list_p = list(range(p0,p1+1,1))
    result = list(set(list_p)-set(pN))
    k0 = abs(result[0])
    for k in result:
        k1 = abs(k)
        if k1<k0:
            k0 = k1
for l in result:
    if l == (-1)*k0:
        print(X-k0)
        break
else:
    print(X+k0)
Problem p02608 (python)

Fixed submission:
a = int(input())
b = round(a**0.5) + 1

x = []
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            l = i**2 + j**2 + k**2 + i*j + j*k + k*i
            x.append(l)

t = [0] * a
for i in range(0,len(x)):
    if x[i] <= a:
        t[x[i]-1] = t[x[i]-1] + 1

for i in t:
    print(i)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = math.floor(a**0.5) + 1

x = []
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            l = i**2 + j**2 + k**2 + i*j + j*k + k*i
            x.append(l)

t = [0] * a
for i in range(0,len(x)):
    if x[i] <= a:
        t[x[i]] = t[x[i]] + 1

for i in t:
    print(i)