Buggy python submission (verdict: Runtime Error):
import itertools
import collections



N = int(input())
count = [0]*N*5
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])


Fixed submission:
import itertools
import collections



N = int(input())
count = [0]*N*100
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])

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

def f(n):
  m = int(n**0.5)
  count = 0
  for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
    if x**2+y**2+z**2+x*y+y*z+z*x==n:
      k = len(set({x, y, z}))
      if k == 1:
        count += 1
      elif k == 2:
        count += 3
      else:
        count += 6
  return count

N = int(input())
for n in range(1, N+1):
  print(f(n))


Fixed submission:
import itertools
import collections



N = int(input())
count = [0]*N*100
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])

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

def f(n):
  m = int(n**0.5)
  out = sum([True for x, y, z in itertools.product(range(1, m+1), repeat=3) if x**2+y**2+z**2+x*y+y*z+z*x==n])
  return out

N = int(input())
for n in range(1, N+1):
  print(f(n))


Fixed submission:
import itertools
import collections



N = int(input())
count = [0]*N*100
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])

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

def f(n):
  m = int(n**0.5)
  out = sum([True for x, y, z in itertools.product(range(1, n+1), repeat=3) if x**2+y**2+z**2+x*y+y*z+z*x==n])
  return out

N = int(input())
for n in range(1, N+1):
  print(f(n))


Fixed submission:
import itertools
import collections



N = int(input())
count = [0]*N*100
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])

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

def f(n):
  out = sum([True for x, y, z in itertools.product(range(1, n+1), repeat=3) if x**2+y**2+z**2+x*y+y*z+z*x==n])
  return out

N = int(input())
for n in range(1, N+1):
  print(f(n))

Fixed submission:
import itertools
import collections



N = int(input())
count = [0]*N*100
m = int(N**0.5)
for x, y, z in itertools.combinations_with_replacement(range(1, m+1), 3):
  n = x**2+y**2+z**2+x*y+y*z+z*x
  k = len(set({x, y, z}))
  if k == 1:
    count[n] += 1
  elif k == 2:
    count[n] += 3
  else:
    count[n] += 6

for n in range(1, N+1):
  print(count[n])