Problem:


Score : 300 points

Problem Statement

Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:

1 \leq x,y,z

x^2 + y^2 + z^2 + xy + yz + zx = n

Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N).

Constraints

All values in input are integers.

1 \leq N \leq 10^4

Input

Input is given from Standard Input in the following format:

N

Output

Print N lines. The i-th line should contain the value f(i).

Sample Input 1

20

Sample Output 1

0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

For n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.

For n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.

For n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.

For n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.



Sample input:
20


Sample output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0

Submission status: Runtime Error

Solution code:
N = int(input())
Pls = [0]*(10**4+1)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k <= 10**4:
                Pls[k] = Pls[k] + 1
Pls.pop(0)
for i in range(N+1):
    print(Pls[i])

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**9)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0] * (10**4)
import math
import numpy
tmp=0
for i in range(1,int(math.sqrt(N))):
    for j in range(1,int(math.sqrt(N))):
        for k in range(1,int(math.sqrt(N))):
            tmp=(i+j+k)**2-(i*j+j*k+i*k)
            if tmp<=10**4:
                A[tmp]+=1
for p in A[1:N+1]:
    print(p)

Submission status: Runtime Error

Solution code:
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])

Submission status: Runtime Error

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

N = int(input())
x = 0
ans = [0 for _ in range(N)]
maxv = ceil(sqrt(N)) + 1
for x in range(1, maxv):
    for y in range(1, maxv):
        for z in range(1, maxv):
            f = x*x + y*y + z*z + x*y + y*z + z*x - 1
            if f > N: continue
            ans[f] += 1
for i in range(N):
    print(ans[i])

Submission status: Runtime Error

Solution code:
N = int(input())
a = [0]*10**4
a = [0]+a
x = 0
y = 0
z = 0
total = 0
for i in range(1,N+1):
  x = i
  for j in range(i,N+1):
    y = j
    for k in range(i,j+1):
      z = k
      total = int(((x+y)**2+(y+z)**2+(z+x)**2)/2)
      if(x==y and y==z):
        a[total]+=1
      elif(x==y or y==z or z==x):
        a[total]+=3
      else:
        a[total]+=6
for l in range(1,N+1):
  print(a[l])

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**5)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

Submission status: Runtime Error

Solution code:
N = int(input())

def shiki(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

anli = [0] * 10100


for x in range(1,150):
    if shiki(x,1,1) > N:
        break

    for y in range(1, x+1):
        if shiki(x,y,1) > N:
            break

        for z in range(1, y+1):
            if x == y and y == z:
                anli[shiki(x,y,z)] += 1
            elif x==y or y==z or z==x:
                anli[shiki(x,y,z)] += 3
            else:
                anli[shiki(x,y,z)] += 6
            if shiki(x,y,z) > N:
                break

for i in range(1,N+1):
    print(anli[i])

Submission status: Runtime Error

Solution code:
import math
n = int(input())

highest = int(math.sqrt(n))
l = [0]*n
cal = 0

for x in range(1, highest+1):
  for y in range(1, highest+1):
    for z in range(1, highest+1):
      cal = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if cal > n+1:
        continue
      else:
        l[cal-1] += 1
        
for i in range(len(l)):
  print(l[i])

Submission status: Runtime Error

Solution code:
L=[]
i=0
while i <10000:
    L.append(0)
    i+=1
for x0 in range(1,100):
    for y0 in range(1,100):
        for z0 in range(1,100):
            p=x0**2+y0**2+z0**2+x0*y0+y0*z0+z0*x0
            if p<10000:
                L[p]+=1
N=int(input())
for i in range(1,N+1):
    print(L[i])

Submission status: Runtime Error

Solution code:
n = int(input())
list = [0]*n
m = int((n-2)**0.5)
for i in range(1, m):
  for j in range(i, m):
    for k in range(j, m):
      if i*i + j*j + k*k + i*j + j*k + k*i <= n:
        if i==j and j == k:
          list[i*i + j*j + k*k + i*j + j*k + k*i-1] += 1
        elif i == j or j == k:
          list[i*i + j*j + k*k + i*j + j*k + k*i-1] += 3
        else:
          list[i*i + j*j + k*k + i*j + j*k + k*i-1] += 6
      else:
        break
for i in range(n):
  print(list[i])

Submission status: Runtime Error

Solution code:
n=int(input())
int(p=n**(1/2)+1)
import itertools
for i in range(1,n+1):
    res=0
    for x in range(1,p):
        for y in range(1,p):
            for z in range(1,p):
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                    res+=1
    print(res)

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**5)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(n):
    print(lis[i])

Submission status: Runtime Error

Solution code:
N = int(input())

def f(n):
    count = 0
    x_max = int(np.sqrt(n-5)//1)
    for x in range(1,x_max+1):
        y_max = int(np.sqrt(n-x**2-4)//1)
        for y in range(1,y_max+1):
            z_max = int(np.sqrt(n-x**2-y**2-3)//1)
            for z in range(1,z_max+1):
                if x**2+y**2+z**2+x*y+y*z+z*x == n:
                    count += 1
    return count

for i in range(5):
    print(0)
for i in range(5,N):
    print(f(i+1))

Submission status: Runtime Error

Solution code:
import sys

def input():
    return sys.stdin.readline()[:-1]


n = int(input())

max_x = int(((2*n-3)**0.5-1)//1)
list_count = [0]*n
for x in range(1,max_x+1):
    for y in range(x, max_x+2-x):
        for z in range(y, max_x+2-x-y):
            s = x**2+y**2+z**2+x*y+y*z+z*x
            if s>=n:
                continue
            if len(set([x,y,z]))==3:
                list_count[s-1] += 6
            elif len(set([x,y,z]))==2:
                list_count[s-1] += 3
            else:
                list_count[s-1] += 1
for i in range(n):
    print(list_count[i])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for i in range(1001)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            if (x*(x+y+z) + y*(y+z) + z*z) <= n:
                ans[(x*(x+y+z) + y*(y+z) + z*z)-1] += 1
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0] * (10**4)
import math
import numpy
tmp=0
for i in range(1,int(math.sqrt(N))):
    for j in range(1,int(math.sqrt(N))):
        for k in range(1,int(math.sqrt(N))):
            tmp=(i+j+k)**2-(i*j+j*k+i*k)
            A[tmp]+=1
for p in A[1:N+1]:
    print(p)

Submission status: Runtime Error

Solution code:
n=int(input())
p=n**(1/2)
import itertools
for i in range(1,n+1):
    res=0
    for x in range(1,p):
        for y in range(1,p):
            for z in range(1,p):
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                    res+=1
    print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
p=n**(1/2)
print(p,"p")
import itertools
for i in range(1,n+1):
    res=0
    for x in range(1,p):
        for y in range(1,p):
            for z in range(1,p):
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                    res+=1
    print(res)

Submission status: Runtime Error

Solution code:
n = 10000
ans = {}
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            i = x**2 + y**2 + z**2 + x*y + y*z + z*x
                ans.setdefault(i, 0)
                ans[i] += 1
for i in range(1, N+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for i in range(1001)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            if (x*(x+y+z) + y*(y+z) + z*z) <= 1000:
                ans[(x*(x+y+z) + y*(y+z) + z*z)-1] += 1
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())

    ans = [0] * 4001
    for i in range(1, 201):
        for j in range(1, 201):
            if i**2 + j**2 < 4001:
                for k in range(1, 201):
                    tmp = i**2 + j**2 + k**2 + i*j + j*k + i*k
                    if tmp < 4001:
                        ans[tmp] += 1

    for i in range(1, N+1):
        print(ans[i])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())

a = [0] * 10010

# x = y = z
x = 1
while True:
  a[6 * x * x] += 1
  x += 1
  if 6 * x * x > n:
    break

# x = y, z
for x in range(1, n+1):
  for z in range(1, n+1):
    if x == z:
      continue
    a[3 * x * x + z * z + 2 * x * z] += 1
    if 3 * x*x + z*z + 2*x*z > n:
      break
  if x * x > n:
    break

# x,y,z
for x in range(1, n+1):
  for y in range(x+1, n+1):
    for z in range(y+1, n+1):
      a[x*x + y*y + z*z + x*y + y*z + z*x] += 1
      if x*x + y*y + z*z + x*y + y*z + z*x > n:
        break
    if x*x + y*y + x*y > n:
      break
  if x*x > n:
    break

for i in range(n):
  print(a[i])

Submission status: Runtime Error

Solution code:
print_cnt = int(input())

result = [0] * 1000

for x in range(100):
  for y in range(100):
    for z in range(100):
      if x*y*z == 0:
        continue
      tmp = x*x + y*y + z*z + x*y + y*z + z*x
      if tmp <= 1000:
        result[tmp-1] += 1

for i in range(print_cnt):
  print(result[i])

Submission status: Runtime Error

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from scipy.sparse.csgraph import floyd_warshall
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations, combinations_with_replacement
from heapq import heappop, heappush, heapify
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def main():
    n = int(input())
    ans = [0 for _ in range(n)]
    for x in range(1,n):
        for y in range(1,n):
            for z in range(1,n):
                if x*x+y*y+z*z+x*y+y*z+x*z-1 >= n+1:
                    break
                ans[x*x+y*y+z*z+x*y+y*z+x*z-1] += 1
    for i in range(n):
        print(ans[i])
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
ans = [0]*(N)

M = int((N-2)**0.5)

for x in range(1, M+1):
  for y in range(1, M+1):
    for z in range(1, M+1):
      a = (x+y+z)**2 - (x*y + y*z + z*x)
      if a <= N:
      	ans[a-1] += 1

for i in range(N):
  print(ans[i])

Submission status: Runtime Error

Solution code:
import math
con = 0;
n = int(input())
nn = n**4
a = [0]*nn

m = int(math.sqrt(n) // 1);
for x in range(1,m+1):
    for y in range(1,m+1):
        for z in range(1,m+1):
            s = x**2 + y**2 + z**2 + x*y + y*z + z*x;
            a[s-1] += 1;


for v in range(n):
    print(a[v]);

Submission status: Runtime Error

Solution code:
n = int(input())
N = 1
while N**2 < n:
    N += 1
ans = [0] * n
for x in range(1,N+1):
    for y in range(1,N+1):
        for z in range(1,N+1):
            a = x**2+y**2+z**2 + x*y+y*z+z*x
            if a >= 20: continue
            if x==y==z: b = 1
            elif x==y or y==z or x==z: b = 3
            else: b = 6
            ans[a-1] =b
            break
for i in ans: print(i)

Submission status: Runtime Error

Solution code:
#c
n=int(input())
import math
nn=int(math.sqrt(n))+1
a=[0]*(8*n)
for x in range(1,nn+1):
    for y in range(1,nn+1):
        for z in range(1,nn+1):
            a[(x+y+z)**2-x*y-x*z-y*z]+=1
for i in range(1,n+1):
    print(a[i])

Submission status: Runtime Error

Solution code:
import numpy as np

def calc(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x

n = int(input())
ans = [0]*n

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = calc(x, y, z)
            if a <= n:
                ans[a-1] += 1

b = [str(i) for i in ans]
print('\n'.join(b))

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for i in range(1000)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            if (x*(x+y+z) + y*(y+z) + z*z) <= 1000:
                ans[(x*(x+y+z) + y*(y+z) + z*z)-1] += 1
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
import math
con = 0;
n = int(input())
nn = n**2
a = [0]*nn

m = int(math.sqrt(n) // 1);
for x in range(1,m+1):
    for y in range(1,m+1):
        for z in range(1,m+1):
            s = x**2 + y**2 + z**2 + x*y + y*z + z*x;
            a[s-1] += 1;


for v in range(n):
    print(a[v]);

Submission status: Runtime Error

Solution code:
ans_lis = [0 for _ in range(n)]
n = int(input())
for x in range(1,101):
    for y in range(1, 101):
        for z in range(1, 101):
            f = x**2+y**2+z**2+x*y+y*z+z*x
            if f<=n:
#                 print(f)
                ans_lis[f-1]+=1
for ans in ans_lis:
    print(ans)

Submission status: Runtime Error

Solution code:
def resolve():
    n=int(input())
    a=[0]*(10001)
    nn=int(n**0.5)
    for x in range(1,nn):
        for y in range(1, nn):
            for z in range(1, nn):
                a[x**2+y**2+z**2+x*y+y*z+z*x]+=1
    for i in range(n):
        print(a[i+1])
resolve()

Submission status: Runtime Error

Solution code:
n=int(input())
import itertools
for i in range(1,n+1):
    a=range(1,n**(1/2))
    b=range(1,n**(1/2))
    c=range(1,n**(1/2))
    res=0
    for x,y,z in itertools.product(a,b,c):
        if x*x+y*y+z*z+x*y+y*z+z*x == i:
            res+=1
    print(res)

Submission status: Runtime Error

Solution code:
N=int(input())
ans=[0]*N
ans[5]=1
for i in range(1,N+1):
    for x in range(1,N+1):
        if x**2>i:
            break
        for y in range(1,N+1):
            if x**2+y**2>i:
                break
            for z in range(1,N+1):
                if x**2+y**2+z**2>i:
                    break
                if x**2+y**2+z**2+x*y+y*z+z*x==i:
                    ans[i-1]=3




for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
n=int(input())
ls=[0]*n
xyz=[1,1,1]
p=6
cnt=0
while p<=n:
  if x==y and x==z:
    ls[p-1]=1
  else:
    ls[p-1]=3
  xyz[cnt%3]+=1
  p=xyz[0]**2+xyz[1]**2+xyz[2]**2+xyz[0]*xyz[1]+xyz[1]*xyz[2]+xyz[0]*xyz[2]
for i in ls:
  print(i)

Submission status: Runtime Error

Solution code:
N=int(input())
for n in range(1,N+1):
    ans = 0
    for i in range(1,int((n**0.5)):
        for j in range(i,int((n**0.5)):
            for k in range(j,int((n**0.5)):
                if i**2+j**2+k**2+i*j+j*k+k*i==n:
                    if i == j and j == k:
                        ans += 1
                    else:
                        ans += 3

    print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
cnt = [0] * (n*n)
for a in range(1, int(n**0.5)+1):
    for b in range(1, int(n**0.5)+1):
        for c in range(1, int(n**0.5)+1):
            cnt[a*a + b*b + c*c + a*b + b*c + c*a] += 1

for i in range(1, n+1):
    print(cnt[i])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for i in range(1010)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            if x*x+y*y+z*z+x*y+y*z+z*x < 1000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
n=int(input())
m=int(n**0.5)
li=[0]*(10**4)
c=0
for i in range(1,m):
  for j in range(1,m):
    for k in range(1,m):
      li[i*i+j*j+k*k+i*j+k*j+k*i-1]+=1
for i in range(n):
  print(li[i])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for i in range(1000)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            if x*x+y*y+z*z+x*y+y*z+z*x < 1000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x-1] += 1

for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
N = int(input())
List = [0 for _ in range(1000)]

for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      k = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if k<=N:
        List[k-1] += 1
        
for i in range(N):
  print(List[i])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for i in range(1000)]
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            if x*x+y*y+z*z+x*y+y*z+z*x < 1000:
                ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1

for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
from collections import defaultdict

N = int(input())


def fun(x, y, z):
  return x**2 + y**2 + z**2 + x*y + y*z + z*x

res = defaultdict(int)

for x in range(1, 50):
  for y in range(1, 50):
    for z in range(1, 50):
      dict[fun(x, y, z)] += 1
        
for n in range(1, N):
  print(dict[n])

Submission status: Runtime Error

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()

a = [0]*n
for i in range(1,int(n**0.5)+1):
    for j in range(1,int(n**0.5)+1):
        for k in range(1,int(n**0.5)+1):
            if i**2+j**2+k**2+i*j+j*k+k*i <= 20:
                a[i**2+j**2+k**2+i*j+j*k+k*i -1] += 1

for i in a:
    print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = [0 for _ in range(1001)]
for i in range(1, 40):
    for j in range(1, 40):
        for k in range(1, 40):
            summ = i**2 + j**2 + k**2 + i * j + j * k + k * i
            if summ < 1001:
                ans[summ] += 1

for i in range(1, n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
N = int(input())
ans = [0] * (N)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x - 1
            if n <= N:
                ans[n] += 1
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
N = int(input())

V = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0, 0, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, 6, 6, 0, 3, 12, 0, 6, 0, 0, 3, 6, 0, 0, 0, 3, 3, 12, 0, 6, 3, 6, 0, 3, 6, 9, 0, 6, 0, 0, 0, 3, 6, 3, 3, 6, 0, 6, 3, 12, 0, 3, 6, 6, 0, 6, 0, 6, 3, 6, 0, 0, 1, 6, 3, 12, 6, 0, 0, 12, 0, 6, 0, 6, 6, 12, 0, 0, 6, 0, 0, 6, 0, 12, 3, 6, 0, 6, 3, 9, 6, 3, 6, 6, 0, 6, 0, 6, 0, 15, 6, 0, 0, 6, 0, 3, 3, 12, 0, 12, 6, 6, 0, 3, 6, 6, 
3, 12, 0, 6, 0, 9, 6, 0, 0, 6, 3, 12, 1, 6, 6, 6, 6, 0, 0, 18, 0, 12, 0, 3, 6, 12, 0, 0,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12, 0, 12, 0, 21, 9, 15, 6, 12, 3, 18, 3, 12, 6, 12, 6, 0, 0, 12, 0, 12, 6, 24, 0, 6, 12, 6, 1, 9, 6, 12, 6, 24, 0, 18, 3, 12, 6, 6, 12, 24, 0, 12, 6, 15, 6, 18, 0, 18, 0, 0, 0, 18, 9, 21, 12, 0, 6, 18, 0, 9, 6, 6, 6, 12, 0, 12, 0, 9, 9, 27, 6, 6, 3, 18, 6, 21, 6, 6, 12, 12, 0, 12, 0, 24, 12, 0, 0, 24, 3, 24, 6, 12, 12, 18, 0, 0, 0, 12, 0, 18, 3, 15, 6, 12, 9, 6, 0, 15, 6, 9, 12, 24, 0, 12, 3, 6, 6, 21, 6, 18, 3, 18, 0, 21, 12, 15, 6, 6, 0, 12, 3, 12, 9, 18, 9, 12, 6, 6, 6, 24, 0, 18, 3, 24, 0, 6, 6, 0, 6, 9, 6, 6, 4, 30, 0, 18, 12, 9, 6, 24, 0, 18, 0, 9, 12, 21, 6, 6, 12, 12, 0, 18, 0, 21, 15, 12, 0, 12, 6, 12, 12, 18, 0, 18, 0, 6, 0, 9, 12, 18, 6, 30, 0, 0, 0, 24, 6, 9, 3, 12, 6, 30, 3, 6, 12, 6, 12, 12, 0, 36, 0, 6, 3, 27, 12, 12, 6, 6, 6, 24, 0, 12, 6, 12, 0, 18, 0, 18, 15, 18, 3, 18, 6, 12, 6, 6, 12, 3, 6, 6, 0, 12, 3, 39, 3, 12, 12, 12, 3, 18, 0, 21, 12, 21, 6, 18, 0, 12, 0, 9, 9, 12, 9, 24, 9, 12, 6, 12, 6, 33, 0, 6, 0, 18, 0, 9, 15, 12, 6, 24, 6, 6, 3, 15, 6, 15, 12, 18, 0, 18, 1, 18, 6, 12, 6, 6, 0, 24, 6, 24, 12, 18, 6, 24, 0, 6, 6, 12, 15, 24, 0, 24, 6, 6, 0, 18, 0, 15, 18, 12, 0, 24, 0, 12, 6, 12, 12, 18, 6, 24, 0, 0, 6, 24, 3, 12, 0, 12, 6, 30, 9, 6, 12, 24, 12, 12, 0, 15, 18, 12, 0, 18, 0, 24, 6, 15, 6, 18, 3, 18, 3, 12, 6, 24, 12, 12, 12, 6, 0, 36, 0, 18, 3, 6, 12, 6, 9, 12, 0, 3, 12, 36, 0, 30, 0, 12, 0, 18, 6, 12, 9, 12, 6, 24, 3, 18, 12, 15, 9, 24, 0, 18, 6, 18, 9, 18, 12, 6, 6, 24, 3, 24, 0, 12, 12, 12, 0, 6, 0, 27, 12, 18, 3, 30, 3, 18, 6]

for i in range (0, N):
	print(V[i])

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

N = int(input())


Ret = [0 for _ in range(10**4+1)]

for i in range(1, N+1):
    for j in range(1, N+1):
        for k in range(1, N+1):
            r = i**2 + j**2 + k**2 + i*j + j*k + i*k
            Ret[r] += 1

for r in Ret[1:N+1]:
    print(r)

Submission status: Runtime Error

Solution code:
N=int(input())
ans=[0]*(N+1)
for i in range(N):
    if i*i>N:
        to=i+1
        break
for x in range(1,to):
    for y in range(1,to):
        for z in range(1,to):
            temp=x*x+y*y+z*z+x*y+y*z+z*x
            if temp<N:
                ans[temp]+=1
for i in range(1,N+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
n = int(input())
a = [0]*(10**4)
for i in range(1,101):
    for j in range(1,101):
        for  k in range(1,101):
            try:
                a[i*i+j*j+k*k+i*j+j*k+i*k]+=1
            except:
                continue
for i in range(1, n+1):
    print(a[i])

Submission status: Runtime Error

Solution code:
from math import sqrt
l = [-1]+[0]*10**4
n = int(input())
for i in range(1,int(sqrt(n))+1):
    for j in range(1,int(sqrt(n))+1):
        for k in range(1,int(sqrt(n))+1):
            l[i**2+j**2+k**2+i*j+j*k+k*i] += 1
for i in range(1,n+1):
    print(l[i])

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>

using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> f(n + 1);
  for (int i = 1; i <= 100; ++i)
    for (int j = 1; j <= 100; ++j)
      for (int k = 1; k <= 100; ++k) {
        int val = i * i + j * j + k * k + i * j + i * k + k * j;
        if (val <= n)
          f[val]++;
      }
  for (int i = 1; i <= n; ++i)
    cout << f[i] << endl;
}

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())

    ans = [0] * (1000 + 1)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x * x + y * y + z * z + x * y + y * z + z * x >= 1001:
                    continue
                ans[x * x + y * y + z * z + x * y + y * z + z * x] += 1

    for i in range(1, N + 1):
        print(ans[i])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n=int(input())

ans=[0]*(1001)
for x in range(1,34):
    for y in range(1,34):
        for z in range(1,34):
            total=x**2+y**2+z**2+x*y+y*z+z*x
            if total<=1000:
                ans[total]+=1

for i in range(1,n+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
array=[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0, 0, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, 6, 6, 0, 3, 12, 0, 6, 0, 0, 3, 6, 0, 0, 0, 3, 3, 12, 0, 6, 3, 6, 0, 3, 6, 9, 0, 6, 0, 0, 0, 3, 6, 3, 3, 6, 0, 6, 3, 12, 0, 3, 6, 6, 0, 6, 0, 6, 3, 6, 0, 0, 1, 6, 3, 12, 6, 0, 0, 12, 0, 6, 0, 6, 6, 12, 0, 0, 6, 0, 0, 6, 0, 12, 3, 6, 0, 6, 3, 9, 6, 3, 6, 6, 0, 6, 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, 0, 6, 3, 18, 0, 12, 6, 12, 6, 24, 0, 15, 18, 9, 6, 0, 0, 18, 3, 6, 0, 15, 12, 12, 6, 6, 0, 18, 0, 6, 3, 12, 0, 12, 6, 6, 9, 9, 6, 24, 3, 24, 0, 9, 12, 6, 6, 12, 0, 12, 0, 21, 9, 15, 6, 12, 3, 18, 3, 12, 6, 12, 6, 0, 0, 12, 0, 12, 6, 24, 0, 6, 12, 6, 1, 9, 6, 12, 6, 24, 0, 18, 3, 12, 6, 6, 12, 24, 0, 12, 6, 15, 6, 18, 0, 18, 0, 0, 0, 18, 9, 21, 12, 0, 6, 18, 0, 9, 6, 6, 6, 12, 0, 12, 0, 9, 9, 27, 6, 6, 3, 18, 6, 21, 6, 6, 12, 12, 0, 12, 0, 24, 12, 0, 0, 24, 3, 24, 6, 12, 12, 18, 0, 0, 0, 12, 0, 18, 3, 15, 6, 12, 9, 6, 0, 15, 6, 9, 12, 24, 0, 12, 3, 6, 6, 21, 6, 18, 3, 18, 0, 21, 12, 15, 6, 6, 0, 12, 3, 12, 9, 18, 9, 12, 6, 6, 6, 24, 0, 18, 3, 24, 0, 6, 6, 0, 6, 9, 6, 6, 4, 30, 0, 18, 12, 9, 6, 24, 0, 18, 0, 9, 12, 21, 6, 6, 12, 12, 0, 18, 0, 21, 15, 12, 0, 12, 6, 12, 12, 18, 0, 18, 0, 6, 0, 9, 12, 18, 6, 30, 0, 0, 0, 24, 6, 9, 3, 12, 6, 30, 3, 6, 12, 6, 12, 12, 0, 36, 0, 6, 3, 27, 12, 12, 6, 6, 6, 24, 0, 12, 6, 12, 0, 18, 0, 18, 15, 18, 3, 18, 6, 12, 6, 6, 12, 3, 6, 6, 0, 12, 3, 39, 3, 12, 12, 12, 3, 18, 0, 21, 12, 21, 6, 18, 0, 12, 0, 9, 9, 12, 9, 24, 9, 12, 6, 12, 6, 33, 0, 6, 0, 18, 0, 9, 15, 12, 6, 24, 6, 6, 3, 15, 6, 15, 12, 18, 0, 18, 1, 18, 6, 12, 6, 6, 0, 24, 6, 24, 12, 18, 6, 24, 0, 6, 6, 12, 15, 24, 0, 24, 6, 6, 0, 18, 0, 15, 18, 12, 0, 24, 0, 12, 6, 12, 12, 18, 6, 24, 0, 0, 6, 24, 3, 12, 0, 12, 6, 30, 9, 6, 12, 24, 12, 12, 0, 15, 18, 12, 0, 18, 0, 24, 6, 15, 6, 18, 3, 18, 3, 12, 6, 24, 12, 12, 12, 6, 0, 36, 0, 18, 3, 6, 12, 6, 9, 12, 0, 3, 12, 36, 0, 30, 0, 12, 0, 18, 6, 12, 9, 12, 6, 24, 3, 18, 12, 15, 9, 24, 0, 18, 6, 18, 9, 18, 12, 6, 6, 24, 3, 24, 0, 12, 12, 12, 0, 6, 0, 27, 12, 18, 3, 30, 3, 18, 6, 0, 12, 15, 6, 18, 0, 24, 0, 9]


N=int(input())
for i in range(1,N+1):
    print(array[i])