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:
# 
import sys

from sys import stdin
input = lambda: stdin.readline().rstrip()

N = int(input())

l = [0] * N
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            v = x**2+y**2+z**2+x*y+y*z+z*x
            if v <= N:
                l[v-1] = l[v-1] + 1

import matplotlib.pyplot as plt

for i in l:
    print(i)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
for i in range(1, N+1):
    ans = 0
    for x in range(1, math.sqrt(i)):
        for y in range(1, math.sqrt(i)):
            for z in range(1, math.sqrt(i)):
                tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if tmp == i:
                    ans += 1
    print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

tmp = []
num = [0]*(10**9)
for i in range(1,10**2+1):
    tmp.append(i**2)
    
for x in tmp:
    xx = int(x**0.5)
    for y in tmp:
        yy = int(y**0.5)
        for z in tmp:
            zz = int(z**0.5)
            ans = x + y + z + xx*yy + yy*zz + zz*xx
            num[ans] += 1
            
for i in range(1,N+1):
    print(num[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*y + z*z + x*y + x*z + y*z < n:
                ans[x*x + y*y + z*z + x*y + x*z + y*z] += 1
            else:
              break
for i in range(1,n+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
from numba import jit

N = int(input())

@jit
def f():
    ret = [0] * 10000

    for i in range(1, 200):
        for j in range(1, 200):
            for k in range(1, 200):
                z = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if z < 10000:
                    ret[z] += 1

    return ret


ans = f()

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

Submission status: Runtime Error

Solution code:
import numpy as np
import math

def func(i):
    j = math.ceil(math.sqrt(i))
    cache = np.zeros([j, j, j], dtype=int)
    for x in range(1, j + 1):
        for y in range(1, max(1, j - x + 1)):
            for z in range(1, max(1, j - x - y + 1)):
                if cache[z, y, x] != 0:
                    cache[x, y, z] = cache[z, y, x]
                elif cache[z, x, y] != 0:
                    cache[x, y, z] = cache[z, x, y]
                else:
                    cache[x, y, z] = calc(x, y, z)
    return cache
  
resolve()

Submission status: Runtime Error

Solution code:
from itertools import combinations_with_replacement
n=int(input())
ans=[0]*1000
list1=list(combinations_with_replacement([1,2,3,4,5,6,7,8,9,10], 3))
for i in range(len(list1)):
    x=list1[i][0]
    y=list1[i][1]
    z=list1[i][2]
    if len(list(set(list1[i])))==1:
        ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=1
    elif len(list(set(list1[i])))==2:
        ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=3
    else:
        ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=6
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
from math import sqrt
N = int(input())
ans = [0] * (N+1)
x = int(sqrt(N-2))+1
for j in range(1, x):
    for k in range(1, x):
        for l in range(1, x):
            y = j**2+k**2+l**2+j*k+k*l+l*j
            if y <= N:
                ans[y] += 1
for n in ans[1:N+1]:
    print(n)

Submission status: Runtime Error

Solution code:
list=[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,
6,
3,
6,
12,
0,
12,
0,
0,
0,
9,
3,
9,
6,
12,
3,
12,
0,
3,
6,
6,
0,
12,
0,
12,
0,
9,
9,
0,
0,
6,
3,
6,
3,
12,
6,
9,
3,
6,
0,
12,
3,
6,
3,
9,
6,
12,
6,
6,
0,
6,
0,
9,
6,
6,
0,
12,
3,
6,
0,
9,
6,
6,
1,
6,
0,
21,
12,
6,
0,
12,
0,
12,
0,
0,
6,
15,
6,
0,
6,
12,
0,
12,
0,
12,
0,
0,
0,
12,
0,
12,
12,
3,
3,
18,
3,
6,
3,
6,
6,
9,
9,
18,
0,
6,
0,
12,
0,
9,
6,
0,
3,
12,
3,
6,
6,
12,
6,
6,
0,
0,
0,
15,
3,
18,
3,
18,
3,
12,
6,
3,
6,
9,
0,
12,
0,
12,
0,
18,
12,
0,
0,
12,
3,
6,
0,
6,
6,
9,
6,
0,
0,
18,
1,
18,
3,
12,
6,
6,
6,
12,
0,
15,
6,
12,
6,
18,
0,
0,
6,
0,
9,
12,
0,
18,
0,
6,
3,
12,
0,
12,
12,
0,
0,
12,
0,
3,
6,
12,
6,
18,
9,
18,
0,
9,
6,
18,
0,
6,
0,
6,
3,
27,
6,
6,
6,
6,
3,
6,
0,
12,
6,
9,
0,
6,
0,
18,
0,
9,
9,
15,
3,
12,
6,
6,
3,
9,
6,
12,
12,
18,
0,
18,
0,
6,
6,
21,
6,
0,
0,
6,
3,
15,
6,
12,
6,
18,
0,
0,
0,
12,
6,
6,
3,
6,
4,
18,
6,
12,
6,
3,
9,
30,
0,
18,
0,
6,
6,
12,
6,
6,
9,
12,
0,
18,
6,
18,
0,
6,
0,
12,
0,
6,
12,
6,
3,
18,
0,
6,
6,
6,
6,
15,
3,
24,
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]
n = int(input())
for i in range(n):
    print(list[i])

Submission status: Runtime Error

Solution code:
import sys
N = int(sys.stdin.readline())
x = int((N / 6)**0.5)
y = int((N - 5)**0.5 + 1)
for n in range(1,N+1):
  ans = 0
  for i in range(1,x+1):
    for j in range(i,x+1):
      for k in range(j,y+1):
        if n == (i + j + k)**2 - i*(j + k) - j*k:
          if i == j:
            if j == k:
              ans += 1
            else:
              ans += 3
          else:
            if i == k:
              ans += 3
            else:
              if j == k:
                ans += 3
              else:
                ans += 6
  print(ans)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
rootN = math.sqrt(N)
rootN = math.floor(rootN)
maxN = 1001
fn_array = [0] * 1000
for x in range(1, rootN):
    for y in range(1, x + 1):
        for z in range(1, y + 1):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if x == y and y == z:
                fn_array[n] += 1
            elif (x == y) and (y != z):
                fn_array[n] += 3
            elif (x != y) and (y == z):
                fn_array[n] += 3
            else:
                fn_array[n] += 6
for n in range(1, N+1):
    print(fn_array[n])

Submission status: Runtime Error

Solution code:
N = int(input())
n = 10**4
tmp = [0]*(10**4)
for x in range(1,int(-(-n**0.5//1))+1):
    for y in range(1,x+1):
        for z in range(1, y+1):
            if x*x + y*y + z*z + x*y + y*z + z*x < 10**4:
                if x == y and y == z and z == x:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x] +=1
                elif x == y or y == z or z == x:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x]  += 3
                else:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x]  += 6
for i in range(1, N+1):
    print(tmp[i])

Submission status: Runtime Error

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

enter = int(math.sqrt(N-3))

value_array = []
for x in range(1, enter):
  for y in range(1, enter):
    for z in range(1, enter):
      value_array.append(x**2 + y **2 + z ** 2 + x*y + y*z + z*x)

for i in range(1, N+1):
  print(value_array.count(i))

Submission status: Runtime Error

Solution code:
n = 10**4
tmp = [0]*(10**4)
for x in range(1,int(-(-n**0.5//1))+1):
    for y in range(1,x+1):
        for z in range(1, y+1):
            if x*x + y*y + z*z + x*y + y*z + z*x < 10**4:
                if x == y and y == z and z == x:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x] +=1
                elif x == y or y == z or z == x:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x]  += 3
                else:
                    tmp[x*x + y*y + z*z + x*y + y*z + z*x]  += 6
for i in range(1, N+1):
    print(tmp[i])

Submission status: Runtime Error

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

m = math.floor(math.sqrt(N-4))+1

def func(n):
    cnt = 0
    for i in range(1, m+1):
        for j in range(1, m+1):
            for k in range(1, m+1):
                if (n == i**2 + j**2 + k**2 + i*j + j*k + k*i):
                    cnt += 1
    
    return(cnt)


for i in range(1, N+1):
    print(func(i))

Submission status: Runtime Error

Solution code:

import math
def func(x,y,z):
    ans = x**2 + y**2 + z**2+ x*y + y*z + z*x
    return ans

N = int(input())
array_N = [0]*N
root_n = round(math.sqrt(n+1))

for x in range(1,root_n):
    for y in range(1,root_n):
        for z in range(1,root_n):
            if func(x,y,z) <= N:
                array_N[func(x,y,z)-1] =array_N[func(x,y,z)-1] +1
                
for i in range(N):
    print(array_N[i])

Submission status: Runtime Error

Solution code:

import math
def func(x,y,z):
    ans = x**2 + y**2 + z**2+ x*y + y*z + z*x
    return ans

N = int(input())
array_N = [0]*N
root_n = round(math.sqrt(n+1))

for x in range(1,root_n):
    for y in range(1,root_n):
        for z in range(1,root_n):
            if func(x,y,z) <= N:
                array_N[func(x,y,z)-1] =array_N[func(x,y,z)-1] +1
                
for i in range(N):
    print(array_N[i])

Submission status: Runtime Error

Solution code:
def foo(x,y,z):
    return x*(x+y) + y*(y+z) + z*(z+x)

N = int(input())

F = [0 for i in range(N)]

for i in range(1,N//6+1):
    for j in range(1,N//6+1):
        for k in range(1,N//6+1):
            X = foo(i,j,k)
            F[X] += 1

for i in F:
    print(i)

Submission status: Runtime Error

Solution code:
n = int(input())

# 最悪
# with open("output.txt", "w") as f:
#     for i in range(1, n + 1):
#         ans = 0
#         for x in range(1, 100):
#             for y in range(1, 100):
#                 for z in range(1, 100):
#                     p = x**2 + y**2 + z**2 + x * y + y * z + z * x
#                     if p > n:
#                         break
#                     if p == i:
#                         ans += 1
#         f.write(str(ans) + ", ")
ans = [
    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,
    6,
    3,
    6,
    12,
    0,
    12,
    0,
    0,
    0,
    9,
    3,
    9,
    6,
    12,
    3,
    12,
    0,
    3,
    6,
    6,
    0,
    12,
    0,
    12,
    0,
    9,
    9,
    0,
    0,
    6,
    3,
    6,
    3,
    12,
    6,
    9,
    3,
    6,
    0,
    12,
    3,
    6,
    3,
    9,
    6,
    12,
    6,
    6,
    0,
    6,
    0,
    9,
    6,
    6,
    0,
    12,
    3,
    6,
    0,
    9,
    6,
    6,
    1,
    6,
    0,
    21,
    12,
    6,
    0,
    12,
    0,
    12,
    0,
    0,
    6,
    15,
    6,
    0,
    6,
    12,
    0,
    12,
    0,
    12,
    0,
    0,
    0,
    12,
    0,
    12,
    12,
    3,
    3,
    18,
    3,
    6,
    3,
    6,
    6,
    9,
    9,
    18,
    0,
    6,
    0,
    12,
    0,
    9,
    6,
    0,
    3,
    12,
    3,
    6,
    6,
    12,
    6,
    6,
    0,
    0,
    0,
    15,
    3,
    18,
    3,
    18,
    3,
    12,
    6,
    3,
    6,
    9,
    0,
    12,
    0,
    12,
    0,
    18,
    12,
    0,
    0,
    12,
    3,
    6,
    0,
    6,
    6,
    9,
    6,
    0,
    0,
    18,
    1,
    18,
    3,
    12,
    6,
    6,
    6,
    12,
    0,
    15,
    6,
    12,
    6,
    18,
    0,
    0,
    6,
    0,
    9,
    12,
    0,
    18,
    0,
    6,
    3,
    12,
    0,
    12,
    12,
    0,
    0,
    12,
    0,
    3,
    6,
    12,
    6,
    18,
    9,
    18,
    0,
    9,
    6,
    18,
    0,
    6,
    0,
    6,
    3,
    27,
    6,
    6,
    6,
    6,
    3,
    6,
    0,
    12,
    6,
    9,
    0,
    6,
    0,
    18,
    0,
    9,
    9,
    15,
    3,
    12,
    6,
    6,
    3,
    9,
    6,
    12,
    12,
    18,
    0,
    18,
    0,
    6,
    6,
    21,
    6,
    0,
    0,
    6,
    3,
    15,
    6,
    12,
    6,
    18,
    0,
    0,
    0,
    12,
    6,
    6,
    3,
    6,
    4,
    18,
    6,
    12,
    6,
    3,
    9,
    30,
    0,
    18,
    0,
    6,
    6,
    12,
    6,
    6,
    9,
    12,
    0,
    18,
    6,
    18,
    0,
    6,
    0,
    12,
    0,
    6,
    12,
    6,
    3,
    18,
    0,
    6,
    6,
    6,
    6,
    15,
    3,
    24,
    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,
]
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

Solution code:
N = int(input())
ans = [0]*N
n = int((N)**(0.5))+1
for x in range(1, n):
    for y in range(1, n):
        for z in range(1, n):
            i = x**2+y**2+z**2+x*y+x*z+y*z
            if i > N:
                break
            else:
                ans[i] += 1
for a in ans:
    print(a)

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())

output = np.zeros(N)

for x in range(1,int(np.sqrt(N-2))+1):
    for y in range(1,x+1):
        if x**2 + y**2 + x*y > N:
            break
        for z in range(1,y+1):
            index = x**2 + y**2 + z**2 + x*y + y*z + z*x
            
            if index > N:
                break
            
            dup = len(set([x,y,z]))
            
            if dup == 3:
                output[index-1] += 6
            elif dup == 2:
                output[index-1] += 3
            elif dup == 1:
                output[index-1] += 1
                
for i in range(N):
    print(int(output[i]))

Submission status: Runtime Error

Solution code:
from math import sqrt

def func(num):
    for i in range(2, lim_n+1):
        for j in range(2, i+1):
            for k in range(2, j+1):
                if i**2 + j ** 2 + k ** 2 == 2 * num:
                    if (j + k) - i != 0 and ((j + k) - i) % 2 == 0:
                        if i == j and j == k:
                            if i  % 2 ==1:
                                break
                            return 1
                        elif i != j and j != k:
                            return 6
                        else:
                            return 3
    return 0

n = int(input())
for i in range(1, n+1):
    print(func(i))

Submission status: Runtime Error

Solution code:
N = int(input())
l = 0
p=0
for i in range(1,100):
    p = i*i
    if p>10000:
        break
    for j in range(1,100):
        q = p + j*j + j*i
        if q>10000:
            break
        for k in range(1,100):
            t  = q + i*k + j*k + k*k
            if q>10000:
                break
            result[l] = t
            l+=1
for i in range(1,N+1):
    print(result.count(i))

Submission status: Runtime Error

Solution code:
import math

n = int(input())
ans = [0]*n
max = int(math.sqrt(n-2))

for x in range(1,max):
  for y in range(1,max):
    for z in range(1,max):
      ns = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if ns < n:
        ans[ns-1] += 1
for a in range(n):
  print(ans[a])

Submission status: Runtime Error

Solution code:
### Problem C
import math

N = int(input())
rt = []

for i in range(1,N+1):
    if i <= 3000:
        rt.append(int(math.sqrt(i)))

for x in range(0,N):
    cnt = 0
    for i in range(1,rt[x]):
        for j in range(1,rt[x]):
            for k in range(1,rt[x]):
                if (i + j + k)**2 == x + (i*j + j*k + k*i):
                    cnt += 1
 print(cnt)

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

#define rep(i,n) for(int i=0; i<(n); ++i)
#define pai 3.1415926535897932384

using namespace std;
using ll =long long;
using P = pair<int,int>;

int N;
int N_array[10001];

int main(int argc, const char * argv[]) {
    
    
    cin >> N;
    
    for(int x=1; x*x<=N; x++){
        for(int y=1; x*x+y*y+x*y<=N; y++){
            for(int z=1; z<=N; z++){
                ll ans = x*x + y*y + z*z + x*y + y*z + z*x;
                if(ans <= N){
                    N_array[ans]++;
                }
            }
        }
    }
    
    for(int i=1; i<=N; i++){
        cout << N_array[i] << endl;
    }
    
    return 0;
}

Submission status: Runtime Error

Solution code:
from collections import Counter
n = int(input())
ans_list = [0]*(10**4)
for i in range(1, 100):
  for j in range(1, 100):
    for k in range(1, 100):
      ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
      ans_list[ans-1] += 1
for i in ans_list[:n]:
  print(i)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
ans = 0
num = {i:0 for i in range(1, N+1)}
upper = int(math.sqrt(N)) + 1
for x in range(1, upper):
    for y  in range(1, upper):
        z = 1
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > n:
            break
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v in num.keys():
                num[v] += 1
            if v > N:
                break
for n in range(1, N+1):
    print(num[n])

Submission status: Runtime Error

Solution code:
n=int(input())
ans=0
for i in range(1,n+1):
  for x in range(1,int((n/6)**(1/2))+1):
    for y in range(x,int(n**(1/2))):
      for z in range(y,-1+(n-2)**(1/2)):
        if (x+y)**2+(y+z)**2+(z+x)**2==2*n:
          if x==y==z:
            ans+=1
          elif (x==y and y!=z) or (x!=y and y==z):
            ans+=3
          elif x!=y and y!=z:
            ans+=6
  print(0)

Submission status: Runtime Error

Solution code:
A = [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, 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, 6, 3, 6, 12, 0, 12, 0, 0, 0, 9, 3, 9, 6, 12, 3, 12, 0, 3, 6, 6, 0, 12, 0, 12, 0, 9, 9, 0, 0, 6, 3, 6, 3, 12, 6, 9, 3, 6, 0, 12, 3, 6, 3, 9, 6, 12, 6, 6, 0, 6, 0, 9, 6, 6, 0, 12, 3, 6, 0, 9, 6, 6, 1, 6, 0, 21, 12, 6, 0, 12, 0, 12, 0, 0, 6, 15, 6, 0, 6, 12, 0, 12, 0, 12, 0, 0, 0, 12, 0, 12, 12, 3, 3, 18, 3, 6, 3, 6, 6, 9, 9, 18, 0, 6, 0, 12, 0, 9, 6, 0, 3, 12, 3, 6, 6, 12, 6, 6, 0, 0, 0, 15, 3, 18, 3, 18, 3, 12, 6, 3, 6, 9, 0, 12, 0, 12, 0, 18, 12, 0, 0, 12, 3, 6, 0, 6, 6, 9, 6, 0, 0, 18, 1, 18, 3, 12, 6, 6, 6, 12, 0, 15, 6, 12, 6, 18, 0, 0, 6, 0, 9, 12, 0, 18, 0, 6, 3, 12, 0, 12, 12, 0, 0, 12, 0, 3, 6, 12, 6, 18, 9, 18, 0, 9, 6, 18, 0, 6, 0, 6, 3, 27, 6, 6, 6, 6, 3, 6, 0, 12, 6, 9, 0, 6, 0, 18, 0, 9, 9, 15, 3, 12, 6, 6, 3, 9, 6, 12, 12, 18, 0, 18, 0, 6, 6, 21, 6, 0, 0, 6, 3, 15, 6, 12, 6, 18, 0, 0, 0, 12, 6, 6, 3, 6, 4, 18, 6, 12, 6, 3, 9, 30, 0, 18, 0, 6, 6, 12, 6, 6, 9, 12, 0, 18, 6, 18, 0, 6, 0, 12, 0, 6, 12, 6, 3, 18, 0, 6, 6, 6, 6, 15, 3, 24, 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]
N = int(input())
for i in range(N):
    print(A[i])

Submission status: Runtime Error

Solution code:
N = int(input())

num = [0]*(10**9)

for x in range(1,int(N**0.5)+1):
    for y in range(1,int(N**0.5)+1):
        for z in range(1,int(N**0.5)+1):
            tmp = x**2 + y**2 + z**2+ x*y + y*z + z*x
            num[tmp] += 1
            
for i in range(1,N+1):
    print(num[i])

Submission status: Runtime Error

Solution code:
a = [0,1]
random(a) * 20

Submission status: Runtime Error

Solution code:
N=int(input())
def sq(n):
    c=0
    A=[0 for j in range(n**2)]
    for i in range(n//2):
        for j in range(i**2,(i+1)**2):
            A[j]=i
    return A
A=sq(N)[0:N+1]
for n in range(1,N+1):
    c=0
    for x in range(1,A[n]):
        for y in range(1,A[n-x**2]):
            for z in range(1,A[n-x**2-y**2]):
                if n==x**2+y**2+z**2+x*y+y*z+z*x:
                    c=c+1
    print(c)

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())

output = np.zeros(N)

for x in range(1,int(np.sqrt(N-2))+1):
    for y in range(1,x+1):
        for z in range(1,y+1):
            index = x**2 + y**2 + z**2 + x*y + y*z + z*x
            
            if index > N:
                break
            
            dup = len(set([x,y,z]))
            
            if dup == 3:
                output[index-1] += 6
            elif dup == 2:
                output[index-1] += 3
            elif dup == 1:
                output[index-1] += 1
                
for i in range(N):
    print(int(output[i]))

Submission status: Runtime Error

Solution code:
def solve():
    n = int(input())
    for i in range(1,n+1):
        cnt = 0
        for x in range(1,int(math.sqrt(i))+1):
            for y in range(1,int(math.sqrt((i-x)))+1):
                rema = i - x**2 - y**2 - x*y
                if rema > 0:
                    for z in range(1, rema):
                        if z**2 + (x+y)*z == rema:
                            cnt += 1
                            break
        print(cnt)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
N=int(input())
def sq(n):
    c=0
    A=[0 for j in range(n**2)]
    for i in range(n//2):
        for j in range(i**2,(i+1)**2):
            A[j]=i
    return A
A=sq(N)[0:N+1]
print(A)
for n in range(1,N+1):
    c=0
    for x in range(1,A[n]):
        for y in range(1,A[n-x**2]):
            for z in range(1,A[n-x**2-y**2]):
                if n==x**2+y**2+z**2+x*y+y*z+z*x:
                    c=c+1
    print(c)

Submission status: Runtime Error

Solution code:
def solve():
    n = int(input())
    for i in range(1,n+1):
        cnt = 0
        for x in range(1,int(math.sqrt(i))+1):
            for y in range(1,int(math.sqrt((i-x)))+1):
                rema = i - x**2 - y**2 - x*y
                if rema > 0:
                    for z in range(1, rema):
                        if z**2 + (x+y)*z == rema:
                            cnt += 1
                            break
                else:
                    break
        print(cnt)
    return 0

if __name__ == "__main__":
    solve()