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.

Solution in C# (.NET Core 3.1.201) (judge verdict: Wrong Answer)

using System;
using System.Collections.Generic;
//using System.Linq;
//using System.Numerics;

class Program {
    static void Main (string[] args) {
        var input = INP();
        int N = TOI(input[0]);

        for(int i = 1;i < N + 1;i++) {
            Cul(i);
        }

    }

    public static void Cul (int i) {
        if(i <= 5) {
            CWL(0);
            return;
        }

        int cnt = 0;
        int baseNum = 1;
        while(true) {
            bool isCount = false;

            for(int j = 0;j < 8;j++) {
                int x = baseNum + (zatsuFlag(j)[0] ? 1 : 0);
                int y = baseNum + (zatsuFlag(j)[1] ? 1 : 0);
                int z = baseNum + (zatsuFlag(j)[2] ? 1 : 0);

                //CWL(i +";;"+ (x * x + y * y + z * z + x * y + y * z + z * x));
                if(i == (x * x + y * y + z * z + x * y + y * z + z * x)) {
                    cnt++;
                    isCount = true;
                }
            }

            if(!isCount) {
                break;
            }

            baseNum++;
        }

        CWL(cnt);
    }

    public static bool[] zatsuFlag (int num) {
        bool[] ret =new bool[3];
        switch(num) {
            case 0:
            ret[0] = false;
            ret[1] = false;
            ret[2] = false;
            return ret;

            case 1:
            ret[0] = true;
            ret[1] = false;
            ret[2] = false;
            return ret;

            case 2:
            ret[0] = false;
            ret[1] = true;
            ret[2] = false;
            return ret;

            case 3:
            ret[0] = true;
            ret[1] = true;
            ret[2] = false;
            return ret;

            case 4:
            ret[0] = false;
            ret[1] = false;
            ret[2] = true;
            return ret;

            case 5:
            ret[0] = true;
            ret[1] = false;
            ret[2] = true;
            return ret;

            case 6:
            ret[0] = false;
            ret[1] = true;
            ret[2] = true;
            return ret;

            case 7:
            ret[0] = true;
            ret[1] = true;
            ret[2] = true;
            return ret;

            default:
            return ret;
        }

        return ret;
    }


    public static List<int> PrimeFactors (int n) {
        var tmpList = new List<int>();
        int i = 2;
        int tmp = n;

        while(i * i <= n) {
            if(tmp % i == 0) {
                tmp /= i;
                tmpList.Add(i);
            } else {
                i++;
            }
        }

        if(tmp != 1) tmpList.Add(tmp);

        return tmpList;
    }

    static string[] INP () {
        return Console.ReadLine().Split(' ');
    }

    static void CWL (string value) {
        Console.WriteLine(value);
    }

    static void CWL (int value) {
        Console.WriteLine(value);
    }

    static void CWL (long value) {
        Console.WriteLine(value);
    }

    static void CWL (float value) {
        Console.WriteLine(value);
    }

    static void CWL (double value) {
        Console.WriteLine(value);
    }

    static int TOI (string str) {
        return int.Parse(str);
    }

    static long TOL (string str) {
        return long.Parse(str);
    }

    static float TOF (string str) {
        return float.Parse(str);
    }

    static double TOD (string str) {
        return double.Parse(str);
    }

    /*static void Main (string[] args) {
        var input = INP();
        var input2 = INP();
        var input3 = INP();

        CWL("dummy");
    }*/
}