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: Wrong Answer

Solution code:
n = int(input())

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,9,0,3,0,0,0,0,0,3,3,9,0,0,3,0,0,0,0,3,3,9,0,9,0,0,0,3,0,0,1,9,0,3,9,0,0,9,0,0,0,0,3,3,3,9,0,9,3,9,0,0,0,9,0,0,0,3,3,12,0,9,3,9,0,3,9,0,0,0,0,9,1,9,0,3,9,0,3,9,0,9,0,0,3,9,0,0,0,3,3,9,0,9,3,9,0,3,9,12,0,9,0,0,0,3,9,3,3,9,0,9,3,9,0,3,9,9,0,9,0,9,3,9,0,0,1,9,3,9,9,0,0,9,0,9,0,9,3,9,0,0,9,0,0,9,0,12,3,9,0,9,3,12,9,3,9,9,0,9,0,9,0,18,9,0,0,9,0,3,3,9,0,9,6,9,0,3,9,9,3,9,0,9,0,3,9,0,0,9,3,9,1,9,9,3,9,0,0,9,0,9,0,3,3,9,0,0,9,3,9,9,0,9,0,0,0,9,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9,9,9,9,9,9,0,9,9,9,9,9,0,9,0,18,9,9,18,9,12,9,9,18,9,9,12,18,0,18,9,9,18,21,18,9,12,9,9,18,9,9,9,9,0,9,3,18,9,9,12,27,9,9,9,9,9,9,18,9,0,9,12,9,9,9,9,9,3,9,0,9,9,9,9,9,0,9,9,9,9,9,9,9,9,9,3,9,9,9,15,9,0,18,9,9,9,9,9,9,0,9,9,9,9,9,18,18,0,9,3,18,3,9,9,9,9,9,0,9,18,9,9,9,0,9,9,18,9,9,9,18,18,9,0,6,18,9,9,27,0,9,0,18,18,12,9,9,9,9,18,18,18,9,9,9,0,9,3,9,12,9,18,9,9,9,3,9,9,9,9,9,0,9,9,12,9,18,0,9,12,9,9,9,18,9,9,9,0,9,9,9,9,9,18,18,9,18,0,9,0,9,9,9,0,18,0,9,9,27,3,9,9,9,9,12,9,9,9,18,0,9,9,9,9,18,9,18,9,9,9,9,9,18,9,18,0,18,0,9,9,21,9,9,9,9,9,12,9,9,9,18,0,9,9,9,9,12,9,9,9,18,0,9,9,9,9,9,0,9,0,9,12,9,9,9,9,9,6,18,9,9,9,9,0,9,9,18,15,9,9,9,9,9,9,9,18,18,0,9,0,9,12,36,9,9,9,9,0,9,9,9,9,9,9,18,0,9,0,18,9,9,9,18,18,18,0,9,9,9,9,9,0,9,0,9,9,18,3,9,3,18,12,9,18,9,9,9,0,9,9,18,9,9,18,9,6,27,9,18,18,9,0,9,0,18,3,9,9,9,18,9,9,9,9,18,9,9,9,9,0,9,9,9,9,12,9,9,3,18,0,9,9,27,18,9,0,9,3,18,3,12,9,9,9,9,9,9,9,9,9,9,0,9,9,9,9,12,9,9,9,9,3,9,9,9,9,9,0,18,9,9,9,3,18,18,9,9,9,9,9,12,12,9,0,9,9,9,18,9,9,18,9,9,0,9,9,9,18,9,0,9,3,9,9,9,9,9,9,18,3,18,18,9,9,18,0,9,9,9,9,9,9,18,9,9,9,9,9,18,9,9,0,9,0,9,18,9,9,9,9,9,0,9,9,9,18,9,0,18,9,9,12,18,9,9,9,18,0,9,9,9,9,9,0,18,3,18,9,0,12,9,12,9,9,9,9,9,12,9,0,9,9,9,9,9,9,9,13,18,0,9,18,9,9,9,0,9,3,9,12,9,12,9,18,9,9,18,9,9,9,9,0,18,9,9,9,18,9,18,3,9,0,12,18,9,9,18,0,18,9,9,9,9,9,9,9,18,0,9,9,18,9,9,0,9,9,9,9,9,9,9,9,9,0,18,9,9,9,18,0,9,9,9,9,18,9,18,3,9,9,9,9,18,0,18,0,9,9,36,9,9,9,9,9,9,0,9,9,9,9,9,0,9,0,9,9,9,9,9,9,9,6,18,18,12,18,9,0,9,9,21,9,9,18,9,3,9,12,9,9,12,9,9,0,9,0,18,9,9,9,9,9,9,9,12,9,9,9,18,0,18,3,9,18,9,9,9,9,9,0,18,9,12,18,18,0,9,9,9,9,18,18,9,9,9,9,9,9,18,12,18,0,9,9,9,18,18,9,9,9,18,3,18,18,9,9,9,0,9,0,9,9,9,9,9,9,27,9,18,9,9,9,9,0,9,9,12,18,9,9,9,6,9,0,9,9,9,9,9,0,18,3,9,9,9,9,9,9,9,3,18,9,9,9,9,0,18,9,9,12,9,9,9,9,9,12,9,9,9,9,18,0,9,0,9,12,18,9,9,18,9,9,9,9,9,3,9,0,18,12,9,9,9,9,18,9,9,0,18,9,9,9,9,0,9,9,9,6,9,9,9,9,9,9,9,9,9,9,9,0,18,9,18,9,9,9,18,12,9,3,9,9,9,9,9,0,9,1,9,9,18,9,9,9,9,9,9,9,9,9,18,0,9,9,9,12,18,9,9,9,9,0,9,9,9,18,9,0,9,0,9,27,18,9,18,9,9,9,9,9,9,9,9,0,9,9,9,3,9,27,9,9,9,9,18,9,21,9,9,0,18,9,12,18,18,9,18,9,9,0,9,9,12,9,9,0,9,9,9,9,18,9,9,9,9,0,9,18,9,9,9,0,9,0,9,9,9,9,18,3,9,9,9,9,9,9,9,0,9,9,12,9,9,9,9,18,9,3,18,9,9,9,9,0,9,0,9,9,9,9,9,9,9,18,9,18,18,9,9,0,9,9,27,9,9,9,9,12,9,0,9,9,18,9,9,0,9,0,9,12,18,9,9,9,9,9,9,9,9,9,18,0,9,0,12,12,9,9,9,9,9,9,21,9,12,9,18,0,9,3,18,9,9,9,9,12,9,9,9,9,9,12,9,0,9,12,9,9,9,9,18,12,18,0,9,9,21,9,9,0,36,9,9,9,9,12,9,3,9,9,9,9,12,9,9,0,9,0,27,9,9,9,9,9,9,3,9,9,27,9,18,0,9,9,9,9,9,6,18,18,9,18,18,9,9,9,18,0,9,18,18,3,9,9,9,9,9,0,18,9,9,9,9,0,9,0,9,9,9,9,9,12,9,9,18,9,18,3,18,0,9,9,9,9,18,9,9,9,9,6,18,9,9,9,9,0,18,0,9,9,9,9,9,0,9,9,18,9,9,9,18,0,18,9,9,9,12,9,9,10,9,0,9,18,9,9,9,0,18,0,9,12,18,9,9,9,9,18,18,9,9,9,9,0,27,0,12,18,9,9,18,18,9,9,9,9,9,9,9,0,9,0,18,9,12,9,9,9,18,9,9,18,9,9,9,0,9,18,9,9,9,9,9,9,9,0,9,9,9,9,9,0,9,0,12,9,9,9,9,12,18,9,18,18,9,9,9,0,18,12,9,9,9,9,9,9,9,0,9,18,9,9,9,0,9,9,9,9,18,9,9,12,9,9,9,9,9,18,9,0,18,3,9,9,9,18,27,9,18,0,9,18,18,9,9,0,9,3,9,12,9,9,9,9,9,15,18,9,9,9,9,0,9,9,18,12,9,18,9,9,9,9,9,0,3,18,9,0,27,3,9,9,9,27,9,9,9,9,9,9,9,9,9,0,9,9,9,21,9,9,9,9,9,0,9,9,9,9,27,0,9,3,9,9,12,9,18,9,9,12,9,9,9,9,9,0,18,9,9,9,18,9,18,9,18,9,9,9,9,9,18,0,9,9,27,12,9,9,9,9,9,9,9,9,27,9,18,0,9,9,9,12,9,9,9,12,9,0,9,9,9,9,18,0,9,12,9,12,9,12,9,9,18,9,9,18,9,3,9,0,9,9,9,9,12,9,9,9,9,9,9,9,12,9,9,0,9,0,9,9,21,18,18,9,18,9,9,18,9,9,9,0,9,9,18,18,18,9,9,9,9,0,9,9,9,9,9,0,9,0,12,9,9,9,9,9,18,3,9,9,3,9,18,0,9,9,9,9,9,9,9,9,9,9,12,9,12,9,9,0,18,0,9,9,9,12,18,9,9,9,9,9,9,9,9,0,9,9,18,18,9,18,18,9,18,0,18,9,9,9,18,0,9,9,9,9,9,9,27,9,9,9,9,9,9,9,9,0,9,0,9,9,9,9,9,9,9,12,9,9,18,9,9,0,9,3,18,0,9,9,9,6,18,9,9,9,9,12,9,0,9,9,9,9,9,9,27,12,9,0,9,18,9,18,9,0,9,3,18,9,9,12,9,9,9,9,9,18,18,9,27,0,9,9,9,12,9,9,18,9,9,9,12,9,9,9,9,0,18,9,18,9,9,9,9,9,18,9,18,9,9,12,9,0,9,9,12,18,18,9,18,9,18,0,12,18,9,18,9,0,9,9,9,9,9,9,18,3,9,3,9,18,9,9,9,0,18,9,9,9,9,0,9,9,9,9,9,0,9,18,9,0,18,0,12,9,18,12,9,9,9,9,9,18,9,9,9,0,9,0,18,9,9,18,9,9,18,0,9,18,12,18,9,0,18,0,9,12,18,0,9,9,9,9,18,18,15,9,18,0,9,12,18,9,9,9,9,9,9,9,12,9,12,9,9,0,9,3,9,18,18,9,18,9,9,0,9,18,9,18,9,0,9,9,9,9,9,9,18,9,9,0,9,18,9,18,9,0,9,3,18,9,9,9,9,9,9,9,18,9,9,9,9,0,9,9,9,9,27,9,9,12,9,9,9,9,12,18,9,0,18,3,9,9,9,18,9,9,9,9,9,9,9,9,9,0,9,9,9,9,9,18,9,9,9,0,9,9,9,0,9,0,9,9,9,18,9,18,18,9,27,9,9,9,9,9,9,0,9,3,27,12,18,9,9,9,9,3,18,9,18,9,9,0,9,9,9,12,9,18,9,9,9,9,18,9,18,9,9,0,9,12,18,9,9,9,18,6,9,0,9,9,9,9,9,0,9,0,9,21,9,9,9,9,9,3,9,9,9,9,9,0,18,9,18,9,18,9,9,9,9,12,9,9,9,9,9,0,18,0,9,9,9,9,9,9,9,18,18,9,9,9,9,0,9,9,9,9,9,9,18,9,9,0,18,9,9,9,9,0,9,0,9,9,9,9,9,0,18,9,12,9,27,9,18,0,9,12,9,18,12,18,0,9,9,3,21,18,9,18,9,0,9,9,9,9,9,9,9,9,9,9,9,9,12,18,18,0,9,0,12,9,9,9,9,9,18,0,9,9,9,27,18,0,9,0,18,9,9,9,9,9,9,9,9,9,18,9,18,0,18,9,0,9,9,18,9,9,9,9,18,9,9,9,9,0,18,3,9,9,18,12,18,9,9,9,9,9,18,9,9,0,18,9,18,9,9,9,9,9,9,0,9,18,18,9,18,0,9,0,9,9,9,9,9,9,9,9,18,9,9,9,9,0,18,9,21,9,9,9,27,9,9,9,9,9,18,9,9,0,9,9,9,9,18,18,9,9,9,9,9,9,9,9,18,0,9,9,9,9,9,9,9,9,9,0,12,9,9,9,18,0,9,9,12,27,9,9,9,12,18,9,9,9,9,21,18,0,9,0,9,9,9,27,9,12,9,0,9,18,9,9,9,0,9,0,9,12,9,12,18,9,18,9,18,9,18,9,9,0,9,9,9,9,18,9,9,3,9,0,18,18,9,9,9,0,18,1,9,9,18,18,9,9,9,9,9,9,9,12,9,0,9,9,9,9,18,9,18,3,18,12,18,9,9,9,18,0,18,3,9,9,9,18,9,9,9,9,9,9,9,9,9,0,9,12,9,9,9,9,9,9,18,0,9,9,9,9,9,0,9,9,9,9,9,9,9,9,18,9,18,9,18,9,9,0,18,9,9,9,9,9,27,9,9,9,9,9,18,9,18,0,9,9,9,9,12,9,9,12,9,9,21,9,9,9,9,0,9,9,9,9,9,18,9,9,9,0,9,9,9,9,9,0,18,0,12,9,18,9,9,6,9,9,18,9,9,9,18,0,9,9,18,9,12,9,9,12,18,9,9,9,9,9,9,0,18,9,18,9,9,9,18,18,9,9,18,9,18,9,18,0,18,18,9,9,18,9,9,9,18,0,9,9,9,9,9,0,18,3,9,18,12,9,9,18,9,0,9,9,9,9,18,0,9,9,9,12,18,9,9,9,9,0,9,9,9,9,9,0,9,0,9,18,9,9,18,9,18,9,9,9,9,9,9,0,18,0,9,9,9,9,18,18,9,0,9,9,9,9,9,0,18,9,9,12,18,9,9,12,9,21,9,9,9,9,9,0,9,0,18,9,9,9,9,18,9,6,9,9,18,9,18,0,9,12,9,9,18,9,18,18,9,9,12,9,18,12,27,0,9,9,18,18,9,9,9,18,9,0,18,9,9,18,9,0,9,0,9,18,9,9,9,9,18,9,9,9,9,18,9,0,9,18,18,9,9,9,18,9,9,9,9,18,9,9,9,0,9,0,9,9,18,18,9,9,9,9,9,9,27,9,9,0,9,9,9,9,9,9,9,0,9,0,9,18,9,9,9,0,9,3,9,9,9,18,9,9,18,3,9,9,9,9,18,0,9,9,18,9,18,9,9,9,9,9,18,9,9,18,9,0,9,0,9,9,12,18,18,9,18,9,12,9,9,9,9,0,9,9,9,18,9,9,9,3,27,0,9,9,18,9,18,0,18,9,9,9,9,3,9,9,27,9,18,9,9,18,9,0,9,0,9,9,9,9,9,9,9,9,9,9,9,18,9,0,9,0,9,9,9,18,9,9,9,9,3,18,9,9,18,0,9,9,9,18,9,9,9,9,9,0,9,9,9,9,9,0,9,0,9,9,9,9,9,12,9,9,9,9,9,9,18,0,18,3,9,9,9,9,18,9,18,9,18,9,9,9,9,0,18,6,18,9,9,9,9,9,27,9,9,9,9,9,9,0,9,9,9,9,12,9,9,0,18,0,9,18,9,9,9,0,18,9,18,3,27,9,9,15,9,9,9,9,18,12,18,0,9,18,9,18,9,9,18,9,18,3,9,9,18,18,9,0,18,9,9,18,27,12,9,9,9,9,9,9,9,9,27,0,9,9,9,18,9,9,9,12,18,0,9,9,9,9,18,0,9,0,9,9,9,9,9,9,18,9,18,0,18,9,9,0,9,9,18,9,18,18,18,9,9,9,9,9,9,9,9,0,9,9,9,9,12,9,27,9,18,9,18,9,9,9,9,0,18,9,18,15,18,9,9,18,18,0,9,9,18,9,9,0,9,0,9,9,9,9,9,9,9,18,9,9,9,9,9,0,9,9,27,9,18,9,9,9,18,0,18,9,18,9,18,0,18,0,9,9,9,9,9,12,18,9,9,9,12,9,18,0,18,9,12,9,9,9,9,9,9,0,18,9,9,9,9,0,9,3,9,9,9,9,9,9,9,9,18,36,9,9,9,0,9,9,9,9,9,9,9,9,18,9,18,9,9,9,9,0,18,9,18,9,9,9,27,9,9,18,9,9,18,9,18,0,9,9,18,9,18,18,9,12,18,0,9,9,18,9,9,0,9,9,9,9,9,9,9,9,18,9,9,9,9,18,9,0,18,9,18,9,9,9,9,9,9,9,9,18,9,0,9,0,9,3,15,18,9,9,18,9,9,9,9,9,27,9,9,0,9,9,18,9,9,9,9,9,9,0,9,9,9,9,9,0,18,0,12,9,9,9,18,9,9,9,9,9,9,9,9,0,9,9,9,12,9,9,9,9,27,12,9,18,18,9,18,0,9,9,12,12,9,18,9,9,9,9,9,9,9,9,9,0,18,12,9,9,9,9,18,3,9,0,9,18,9,9,18,0,18,0,9,12,9,12,9,9,9,18,9,9,9,12,9,0,9,9,9,18,18,9,9,18,9,6,18,9,18,18,9,0,9,0,9,9,9,9,9,12,9,18,9,9,9,12,9,0,9,18,18,12,18,9,9,18,9,0,9,9,9,9,9,0,9,0,9,9,18,9,9,9,9,0,9,9,9,9,9,0,9,12,9,9,9,9,9,9,9,9,9,9,36,9,9,0,9,9,9,9,9,9,9,9,9,9,9,18,12,9,9,0,9,9,9,9,9,9,9,9,9,0,9,9,15,18,18,0,9,3,9,18,9,18,18,9,9,18,9,9,12,9,18,0,9,9,9,9,9,9,9,9,9,3,21,27,9,9,18,0,18,9,18,9,18,9,9,9,18,9,27,9,18,9,18,0,18,9,9,9,9,9,9,9,9,0,9,9,9,9,9,0,9,3,18,18,9,9,9,12,18,9,9,9,18,18,18,0,18,12,9,9,9,9,9,9,9,9,18,9,9,9,9,0,18,9,9,9,18,9,9,9,18,9,18,9,9,9,18,0,9,9,9,9,9,18,9,10,18,0,18,9,18,9,9,0,9,9,9,9,9,9,9,18,27,3,18,9,9,12,9,0,9,9,9,18,9,9,9,9,9,9,9,9,9,18,9,0,9,0,9,12,9,18,9,12,18,0,9,18,3,12,9,0,18,9,9,9,9,9,9,15,18,0,9,9,12,9,9,0,9,0,9,18,9,9,18,9,9,18,9,9,9,9,9,0,9,9,9,9,18,9,9,9,18,3,9,9,27,9,18,0,9,9,9,9,9,9,9,9,9,9,18,9,9,12,18,0,18,9,9,9,18,9,18,9,9,0,9,9,9,18,9,0,9,9,9,9,12,9,27,9,27,3,18,9,9,9,9,0,9,0,9,9,18,9,9,18,9,9,9,9,9,9,9,0,9,0,9,9,18,9,18,0,9,18,9,9,18,18,18,0,18,9,9,9,9,9,9,9,9,0,18,9,18,9,9,0,9,3,9,3,18,9,9,9,9,9,9,9,18,9,18,0,9,9,9,18,12,9,9,9,9,3,12,9,9,9,18,0,9,9,9,9,9,9,9,9,18,9,9,18,9,15,9,0,9,9,12,18,9,9,18,9,9,0,9,18,12,18,9,0,18,9,18,18,12,18,9,9,9,9,18,18,9,18,9,0,9,9,9,9,9,18,18,12,18,9,12,18,18,9,9,0,9,0,9,18,9,9,9,9,9,9,9,18,9,9,27,0,9,0,9,9,18,27,18,9,9,0,9,9,9,9,9,0,9,0,9,9,9,9,9,9,9,9,9,9,9,18,9,0,9,9,9,9,27,9,9,9,9,3,27,18,9,9,9,0,9,9,12,9,9,9,9,6,18,9,9,9,9,9,9,0,9,9,18,9,9,9,18,9,9,0,9,9,9,9,9,0,9,3,9,12,9,9,9,18,9,12,18,9,18,9,9,0,9,9,18,12,18,9,9,9,18,9,18,9,9,9,18,0,9,4,18,9,9,18,9,9,18,9,9,9,18,9,18,0,9,18,18,12,18,9,9,9,9,0,18,9,18,9,9,0,9,9,9,9,9,9,18,9,9,12,18,18,18,9,9,0,9,9,18,9,3,18,9,9,18,9,9,18,9,9,9,0,9,9,9,12,9,9,9,9,9,9,9,9,9,18,9,0,9,3,27,18,27,9,18,9,18,0,18,18,9,9,18,0,9,12,9,9,18,18,9,18,9,9,9,9,9,9,18,0,18,18,27,9,9,9,9,3,9,9,18,9,9,9,18,0,9,0,18,3,9,9,18,9,9,9,18,9,18,3,9,0,18,9,9,12,21,9,9,9,9,0,21,9,18,9,9,0,9,0,9,9,21,9,18,12,9,12,9,9,9,9,9,0,9,9,9,9,18,9,9,9,9,9,9,18,9,0,18,0,9,3,18,18,12,18,9,9,9,9,9,9,9,9,9,0,9,9,18,9,27,9,9,9,9,0,9,9,9,9,27,0,9,9,9,9,9,9,18,9,18,9,9,9,12,9,9,0,9,9,9,9,9,18,9,9,9,3,27,18,9,18,18,0,9,12,9,9,36,9,9,9,9,9,9,9,9,9,9,0,9,9,21,9,9,9,18,9,9,0,9,9,9,9,18,0,18,0,9,9,12,9,9,9,18,9,18,9,9,18,18,0,9,9,18,9,9,9,18,9,9,9,9,9,18,9,9,0,9,9,9,9,9,9,9,12,18,9,9,9,9,12,9,0,9,9,9,9,9,9,18,6,9,0,9,9,18,9,9,0,18,0,9,9,9,27,18,9,9,9,36,9,9,9,9,0,9,9,9,27,9,9,9,12,9,12,9,18,9,18,9,0,9,0,9,9,9,9,9,9,27,9,18,18,9,9,9,0,9,9,9,9,9,9,9,18,9,0,9,9,18,18,9,0,9,0,9,9,18,9,9,12,9,18,18,9,18,9,9,0,9,3,9,27,9,9,9,9,9,9,15,18,9,9,18,0,18,9,9,18,9,12,9,9,18,9,18,9,18,9,18,0,18,9,9,18,18,9,9,9,9,0,12,9,18,9,18,0,9,3,9,9,9,18,9,9,18,9,9,18,9,9,9,0,18,18,18,9,21,9,18,9,9,9,9,9,21,9,9,0,36,0,12,9,9,18,9,9,9,9,9,9,9,18,9,0,9,9,18,9,9,9,9,9,9,0,12,18,18,9,9,0,9,9,9,9,9,3,18,9,9,12,9,9,9,9,9,0,9,9,9,9,9,18,9,9,18,9,9,9,18,9,18,0,9,9,9,18,9,9,18,9,9,9,9,9,9,9,9,0,9,12,9,9,9,9,18,9,18,0,18,9,9,9,18,0,9,3,9,9,18,18,18,9,9,9,9,9,18,9,9,0,9,9,9,9,27,9,18,9,9,9,9,9,9,9,9,0,9,0,18,9,9,9,9,9,9,9,9,9,9,9,9,0,9,9,9,27,9,9,18,9,9,0,9,18,9,9,27,0,9,3,18,9,9,9,9,9,9,9,9,9,27,18,18,0,9,9,9,12,9,9,36,9,9,12,18,18,9,9,9,0,18,0,9,9,27,9,9,9,9,9,18,9,9,9,9,0,18,12,18,9,9,9,9,9,9,0,9,9,18,9,9,0,9,9,12,12,9,9,18,18,9,9,9,9,9,9,18,0,9,9,9,9,18,9,9,6,18,12,9,18,18,9,9,0,18,3,18,9,9,18,9,18,9,9,12,9,9,9,9,0,18,9,18,9,9,9,9,9,9,0,9,18,9,9,9,0,9,0,9,9,9,9,18,9,18,9,9,9,9,9,9,0,9,9,9,9,18,9,9,18,18,3,27,18,9,9,18,0,9,18,9,9,18,12,9,9,18,9,9,9,9,18,9,0,9,9,9,12,9,9,18,18,18,0,9,9,9,9,9,0,9,9,9,9,15,18,9,3,9,9,18,9,12,9,9,0,9,0,12,18,18,9,9,9,9,13,18,9,21,18,9,0,18,0,9,9,9,9,9,9,9,9,9,9,9,9,18,0,9,9,18,27,9,18,9,9,18,0,18,9,9,27,18,0,9,3,18,9,18,9,9,9,18,9,9,9,18,9,9,0,9,9,18,9,9,18,18,9,9,9,9,9,9,9,9,0,9,0,18,18,12,9,9,9,18,9,9,18,18,9,9,0,9,12,9,3,9,18,18,9,9,0,9,9,9,9,9,0,9,9,9,18,9,9,9,3,18,18,9,9,18,9,9,0,9,9,9,9,18,18,18,9,9,0,9,18,18,9,18,0,9,9,18,9,18,9,9,9,18,9,9,9,12,9,9,0,9,9,9,12,9,9,18,9,18,0,18,9,9,9,9,0,18,0,36,18,18,9,9,12,9,0,9,9,9,6,9,0,18,9,9,9,9,9,9,12,9,9,12,27,9,9,18,0,9,0,9,18,9,9,9,9,18,9,18,9,9,9,18,0,9,9,9,12,18,18,9,12,18,0,12,9,9,9,18,0,9,3,9,18,9,9,9,9,9,9,9,9,9,12,18,0,9,9,9,9,9,9,36,9,18,9,9,9,9,9,9,0,9,0,9,9,9,9,9,9,18,9,9,9,9,9,9,0,9,9,9,9,9,9,9,18,9,0,9,9,18,9,9,0,9,9,9,9,9,12,9,9,9,12,12,9,9,18,27,0,18,6,18,9,18,9,9,3,9,9,18,18,9,9,9,0,9,9,21,9,9,9,9,9,9,18,27,9,9,18,9,0,9,12,9,9,9,18,9,18,9,0,18,9,9,9,18,0,18,9,9,9,18,9,9,9,9,9,9,9,27,9,9,0,9,18,18,9,9,9,9,9,9,0,9,9,9,9,18,0,9,3,12,9,9,9,9,9,18,9,18,9,9,9,9,0,9,9,9,18,9,9,18,9,18,0,12,9,9,18,9,0,9,0,9,9,9,9,9,9,9,9,9,18,18,9,9,0,9,9,9,18,9,9,9,9,9,9,9,9,9,9,18,0,18,9,9,9,9,18,9,10,9,9,12,18,27,9,27,0,9,9,9,12,18,9,27,9,9,0,18,9,18,9,9,0,9,9,12,9,9,9,9,3,18,9,9,18,18,9,9,0,18,9,18,9,9,9,9,15,18,9,9,9,9,18,9,0,9,0,18,3,18,9,18,18,9,0,18,9,18,3,18,0,18,9,18,18,9,9,9,9,9,0,9,9,9,18,9,0,9,0,18,12,9,9,9,9,18,21,9,9,9,9,18,0,9,9,9,21,18,9,18,9,9,9,9,9,9,9,9,0,9,12,18,9,9,9,18,9,9,9,18,9,18,9,9,0,9,18,9,12,9,9,9,9,9,0,9,18,9,9,18,0,9,9,9,9,9,9,9,9,9,15,18,9,9,9,9,0,9,9,18,9,21,27,9,18,18,9,9,9,9,18,9,0,9,3,9,9,18,9,9,9,9,9,9,18,9,18,9,0,18,9,9,9,9,9,9,9,18,0,36,9,18,9,9,0,9,3,9,9,9,18,9,9,9,9,18,9,18,3,18,0,18,9,9,18,9,9,18,9,9,9,9,9,18,9,18,0,9,9,9,12,36,18,9,9,18,9,9,9,9,9,9,0,9,9,18,9,9,9,9,9,9,0,9,9,9,9,18,0,9,9,9,9,12,9,18,12,18,6,12,9,9,9,9,0,18,0,9,18,9,9,9,18,18,12,9,9,9,9,9,0,9,0,9,18,18,9,9,9,9,18,9,9,9,9,18,0,18,9,18,12,12,9,9,12,9,0,9,9,9,18,18,0,18,0,18,18,18,18,9,18,9,9,9,9,9,9,9,0,18,9,18,9,9,9,9,9,9,9,9,9,9,9,18,0,9,6,9,9,9,9,9,9,9,9,9,9,9,9,9,0,9,9,12,18,9,9,18,9,9,0,9,18,9,9,9,0,9,0,18,9,18,9,18,9,9,9,9,9,9,9,9,0,9,9,18,9,9,9,9,9,9,9,9,9,9,9,18,0,9,9,9,9,9,9,9,18,18,9,9,9,9,9,9,0,18,9,9,27,9,9,27,9,9,0,9,9,9,27,9,0,9,1,18,9,18,9,9,12,9,12,9,18,9,15,9,0,9,12,9,9,9,9,27,12,9,9,18,9,9,18,9,0,27,9,9,9,9,12,27,9,9,18,9,9,18,9,9,0,9,9,18,12,9,18,9,9,9,0,9,18,9,9,9,0,9,9,9,9,9,9,9,18,9,9,9,9,9,12,9,0,9,18,9,9,9,9,18,9,9,9,9,18,21,9,18,0,9,0,18,9,9,9,9,12,18,9,9,9,18,9,9,0,18,9,9,9,9,9,18,9,9,0,9,18,9,9,9,0,9,3,9,9,9,9,27,9,9,9,9,9,9,9,9,0,9,9,9,9,12,9,9,9,9,9,12,9,9,9,9,0,9,9,9,9,18,9,9,9,9,9,18,9,9,9,9,0,9,9,18,18,9,9,18,9,9,0,9,9,9,9,9,0,18,9,9,9,9,18,9,9,9,9,12,18,21,6,9,0,18,9,30,18,9,9,18,9,9,3,18,9,18,9,9,0,18,0,9,18,18,9,9,9,9,9,9,18,9,0,18,0,9,9,18,9,9,18,9,9,9,0,9,9,12,9,18,0,27,9,9,9,9,9,18,12,18,9,9,18,9,18,9,0,18,12,9,9,9,9,9,9,9,9,9,9,9,9,9,0,18,9,27,9,9,9,9,12,9,9,9,18,12,9,9,0,9,9,18,9,9,18,9,9,9,0,9,9,18,9,9,0,9,0,9,18,9,18,9,9,18,9,18,18,18,9,9,0,9,9,21,18,18,18,18,12,18,12,9,9,9,9,18,0,9,0,18,9,9,9,9,9,9,9,9,18,9,18,9,0,18,0,18,9,9,18,18,9,9,0,9,9,15,18,9,0,9,0,18,9,18,18,9,9,9,9,9,9,18,9,9,0,9,9]

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())
    ans = [0]*(N+1)

    end = math.ceil(math.sqrt(N))

    for i in range(3,end+1):
        sn = i
        x = 1
        y = 1
        z = sn - 2
        ans[cal(x,y,z)] += func(i,x,y,z)
        while z >= math.ceil(sn / 2):
            y += 1
            z -= 1
            if x > z or y > z:
                break
            ans[cal(x,y,z)] += func(i,x,y,z)
            for j in range(y):
                x += 1
                z -= 1
                if x > z or y > z:
                    break
                ans[cal(x,y,z)] += func(i,x,y,z)
    
    for i in range(1,N+1):
        print(ans[i])
        

def func(n,x,y,z):
    if x == y and y == z and z == x:
        return 1
    elif x != y and y != z and z != x:
        return 6
    else:
        return 3

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

main()

Submission status: Wrong Answer

Solution code:
import time
import itertools


N = int(input())
def function(x,y,z):
    return pow(x,2) + pow(y,2) + pow(z,2) + (x * y) + (x * z ) + (y * z)

count = 0
start = time.time()

p = list(itertools.product(range(1,25),repeat=3))
a = []

for p_in in p:
    a.append(function(p_in[0],p_in[1],p_in[2]))

for n in range(1,N + 1):
    print(a.count(n))

elapsed_time = time.time() - start
# print("elapsed_time:{0}".format(elapsed_time) + "[sec]")

Submission status: Wrong Answer

Solution code:
N=1000
for i in range(N):
    ret=0
    x=1
    y=1
    z=1
    while x*x+y*y+z*z+x*y+y*z+z*x <= i: 
        if x*x+y*y+z*z+x*y+y*z+z*x==i:
            ret=ret+1
        if x==y:
            x+=1
        elif y==z:
            y+=1
        else :
            z+=1
    print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())

nums = [0]*n
m = n//6
for i in range(1,m+1):
  if i**2//6 >= n: break
  for j in range(i, m+1):
    if i**2 + j**2 + i*j >= n//2: break
    for k in range(j, m+1):
      t = i**2 + j**2 + k**2 + i*j + j*k + i*k
      if t <= n:
        if i == j and i == k: nums[t-1] += 1
        else: nums[t-1] += 3
        
print(*nums, sep="\n")

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
def f(N):
    global table
    for x, y, z in combinations_with_replacement(range(1, 100), 3):
        n = x**2+y**2+z**2+x*y+y*z+z*x
        if n>N:
            continue
        if x==y==z:
            table[n] = 1
        elif x==y or y==z or z==x:
            table[n] = 3
        else:
            table[n] = 6
N = int(input())
table = [0 for _ in range(N+1)]
f(N)
for n in range(1, N+1):
    print(table[n])

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [0]*(N+1)
RANGE = 333
for i in range(1, RANGE):
  if i**2 < N:
    for j in range(1, RANGE):
      if i**2 + j**2 + i*j < N:
        for k in range(1, RANGE):
          wd = i**2 + j**2 + k**2 + i*j + j*k + k*i
          if wd < N:
            #print(wd)
            #print(i, j, k)
            ans[wd] += 1
          else:
            break
      else:
        break
  else:
    break
    
for i in range(1,N+1):
  print(ans[i])

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
l = [0]*250939
count = 0
for x in range(1,500):
    for y in range(1,500):
        for z in range(1,500):
            tmp = (x+y+z)**2-(x*y+y*z+z*x)
            if tmp <= 10**4:
                l[count] = tmp
                count+=1
            else:
                break
l = sorted(l)
print(len(l))
C = collections.Counter(l)
for j in range(1,n+1):
    print(C[j])

Submission status: Wrong Answer

Solution code:
def f(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
def calc(n):
    result_dict = {}
    for x in range(1,n):
        if n < f(x, 1, 1):
            return result_dict
        for y in range(1,n):
            if x < y:
                break
            for z in range(1, n):
                if y < z:
                    break
                if n < f(x, y, z):
                    break
                result_dict[f(x,y,z)] = (x, y, z)
    return result_dict

def output_result(result):
    if result:
        length = len(set(result))
        if length == 3:
            print(6)
        elif length == 2:
            print(3)
        elif length == 1:
            print(1)
        else:
            print(0)
    else:
        print(0)

n = int(input())
result_dict = calc(n)
for i in range(1, n+1):
    output_result(result_dict.get(i, False))
    # print(f"{i}: {result_dict.get(i, 0)}")

Submission status: Wrong Answer

Solution code:
def fx(n):
  cnt = 0

  for i in range(1,10000):
    if (i+1+1)**2 - i*1 - 1*1 - 1*i > n: break
    for j in range(1, 10000):
      if (1+j+1)**2 - 1*j - j*1 - 1*1 > n : break
      for k in range(1, 10000):
        formula = (i+j+k)**2 - i*j - j*k - k*i
        if formula == n:
          cnt+=1
        if formula >= n:
          break
  
  return cnt


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

Submission status: Wrong Answer

Solution code:
N = int(input())

a = [0]* N

x = [i for i in range(1,43)]
y = [i for i in range(1,43)]
z = [i for i in range(1,43)]
ans = []
for i in x:
    for j in y:
        for k in z:
            t = (i**2+j**2+k**2+i*j+j*k+k*i)
            if t <= N:
                a[t] += 1
            
for i in range(N):
    print(a[i])

Submission status: Wrong Answer

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

def func(n):
    cnt = 0
    for x in range(1, 34):
        if x * x > n:
            break
        for y in range(1, 34):
            if y * y > n:
                break
            for z in range(1, 34):
                if z * z > n:
                    break
                if x * x + y * y + z * z + x * y + y * z + z * x == n:
                    cnt += 1
                    break
    return cnt


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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
for n in range(1, N+1):
  sum = 0
  m = n//6 + 1
  for x in range(1, m):
    for y in range(1, m):
      for z in range(1, m):
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
          sum += 1
  print(sum)

Submission status: Wrong Answer

Solution code:
import math
N = int(input()) + 1
#Nroot = int(math.sqrt(N/3))+1
for n in range(1,N):
    count = 0
    if n >= 6:
#        print(Nroot, int(math.pow(n,1/3))-1)
        for x in range(int(math.sqrt(n/3))+1, int(math.sqrt(n/3))-1 , -1):
            for y in range(x,0,-1):
                if (x+2*y)**2 < n:
                    break
                for z in range(1,y+1):
#                    print((x + y + z)**2 - (x*y + y*z + z*x), n,x,y,z)
#                    print(x,y,z)
                    formula = (x + y + z)**2 - (x*y + y*z + z*x)
                    if formula == n:
                        if x == y and y == z:
                            count += 1
                        else:
                            count += 3
                        break

        print(count)
    else:
        print("0")

Submission status: Wrong Answer

Solution code:
#from matplotlib import pyplot as plt
def binary_search(mn,mx,a,x,y):
    #リストlからaの値のインデックスをサーチする。
    #二分探索を可能にするためにはリストlはソートされていなければならない。
    z = (mx+1)//2
    low = mn
    high = mx+1
    while low <= high:
        temp = rule2(x,y,z)
        if temp == a:
            return z
        elif temp < a:
            low = z + 1
        elif temp > a:
            high = z - 1

        z = (low + high) // 2
    return None

def rule2(x,y,z):
    return x ** 2 + y ** 2 + z**2 + x * y + y * z + z*x
def main():
    n = int(input())
    x = []
    y = []
    for i in range(1,n+1):
        #x.append(i)
        #y.append(f(i))
        print(f(i))
    #plt.scatter(x,y)
    #plt.show()


def f(n):
    counter = 0
    for x in range(1,n):
        if x ** 2 > n:
            break
        for y in range(x,n-x**2):
            if y < x:
                continue
            if x ** 2 + y ** 2 > n:
                break
            z = binary_search(y,n-x**2-y**2-x*y,n,x,y)
            if z == None:
                continue
            else:
                if x ** 2 + y ** 2 + z **2 > n:
                    break
                if rule2(x,y,z) == n:
                    if x == y and y == z and z == x:
                        counter += 1
                    elif x != y and y != z and z != x:
                        counter += 6
                    else:
                        counter += 3

    return counter


if __name__ == '__main__':
    main()

#6 24 54 96
#1  4  9 16
#18