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++ (GCC 9.2.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
#define test cout << "test ok" << endl;
#define sp << " " <<
using namespace std;
using ll = long long;
ll mod = ll(1e9)+7;
ll inf = ll(1e18);
void yn(bool b){ cout << (b ? "Yes" : "No") << endl; }
void YN(bool b){ cout << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){a=b; return true;} return false; }
template<typename T> inline bool chmin(T &a, T b){ if(a>b){a=b; return true;} return false; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

#define TO_STRING(varName) # varName
#include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;

namespace dbg {

using ll = long long;

class Debug {
  void prefix() { cout << "\033[7m\033[35m" << " DEBUG " << "\033[0m" << endl; }

  void out_helper(){ cout << endl; }

  void out_with_name_helper(){ cout << endl; }

  template<typename T1, typename... T2>
  void out_helper(T1 v, T2... args);

  template<typename T1, typename... T2>
  void out_with_name_helper(string s, T1 v, T2... args);

  // value
  template<typename T>
  void print(T val);

  // pair
  template<typename A, typename B>
  void print(pair<A, B> p);

  // tuple
  template<typename A, typename B, typename C>
  void print(tuple<A, B, C> t);

  // vector
  template<typename T>
  void print(vector<T> &vec);

  // set
  template<typename T>
  void print(set<T> &st);

  // map
  template<typename A, typename B>
  void print(map<A, B> mp);
public:
  Debug(){}

  template<typename... T>
  void out(T... args){
    prefix();
    out_helper(args...);
  }

  template<typename... T>
  void out_with_name(T... args){
    prefix();
    out_with_name_helper(args...);
  }

  template<typename T>
  void outg(vector<vector<T>> &g) {
    prefix();
    for(auto& v1 : g){
      for(auto& v2 : v1) {
        cout << v2 << " ";
      }
      cout << endl;
    }
  }
};

template<typename T1, typename... T2>
void Debug::out_helper(T1 v, T2... args) {
  print(v); cout << endl;
  out_helper(args...);
}

template<typename T1, typename... T2>
void Debug::out_with_name_helper(string s, T1 v, T2... args) {
  cout << s << ": "; print(v); cout << endl;
  out_with_name_helper(args...);
}

template<typename T>
void Debug::print(T val){
  cout << val;
}

template<typename A, typename B>
void Debug::print(pair<A, B> p){
  cout << "("; print(p.first); cout << ", "; print(p.second); cout << ")";
}

template<typename A, typename B, typename C>
void Debug::print(tuple<A, B, C> t) {
  cout << "("; print(get<0>(t)); cout << ", "; print(get<1>(t)); cout << ", "; print(get<2>(t)); cout << ")";
}

template<typename T>
void Debug::print(vector<T>& vec) {
  cout << "[";
  bool fir = true;
  for(auto& e : vec) {
    if(!fir) cout << " ";
    print(e), fir=false;
  }
  cout << "]";
}

template<typename T>
void Debug::print(set<T> &st){
  cout << "{";
  bool fir = true;
  for(auto& e : st) {
    if(!fir) cout << " ";
    print(e), fir=false;
  }
  cout << "}";
}

template<typename A, typename B>
void Debug::print(map<A, B> mp){
  cout << "{";
  bool fir = true;
  for(auto& p : mp){
    if(!fir) cout << " ";
    print(p), fir=false;
  }
  cout << "}";
}

}

#endif //INCLUDE_DEBUG_HPP

dbg::Debug debug;

void solve() {
  ll n;
  cin >> n;
  vector<ll> cnt(n+1, 0);
  for(int i=1; i*i<=sqrt(1e4); i++){
	for(int j=1; j*j<=sqrt(1e4); j++){
	  for(int k=1; k*k<=sqrt(1e4); k++){
		ll x = i*i + j*j + k*k + i*j + j*k + k*i;
	    if(x <= n) {
		  cnt[x]++;
		}
	  }
	}
  }
  for(int i=1; i<=n; i++){
	cout << cnt[i] << endl;
  }
}

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  solve();
}