jiahuimbzuai/CoQuIR huggingface dataset:
//  [swift]
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}
///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let nq = readInts()
    let (n, q) = (nq[0], nq[1])
    let s = readLine()!.map { String($0) }
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    var aryACIndex = [Int]()
    for i in 1..<n {
        if s[i - 1] == "A" && s[i] == "C" {
            aryACIndex.append(i)
        }
    }
    
    for _ in 1...q {
        let lr = readInts()
        let (l, r) = (lr[0], lr[1])
        var ans = 0
        for i in 0..<aryACIndex.count {
            if aryACIndex[i] >= l && aryACIndex[i] < r {
                ans += 1
            }
            if aryACIndex[i] >= r {
                break
            }
        }
        print(ans)
    }
}
main()
//  [swift]
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}
///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let nq = readInts()
    let (n, q) = (nq[0], nq[1])
    let s = readLine()!.map { String($0) }
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    var aryACIndex = [Int]()
    for i in 1..<n {
        if s[i - 1] == "A" && s[i] == "C" {
            aryACIndex.append(i)
        }
    }
    
    for _ in 1...q {
        let lr = readInts()
        let (l, r) = (lr[0] - 1, lr[1] - 1)
        var ans = 0
        for i in 0..<r {
            if aryACIndex[i] >= l && aryACIndex[i] <= r {
                ans += 1
            }
        }
        print(ans)
    }
}
main()
//  [swift]
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}
///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = index(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let nq = readInts()
    let (n, q) = (nq[0], nq[1])
    var s = readLine()!.map { String($0) }
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    var aryACIndex = [Int]()
    for i in 1..<n {
        if s[i - 1] == "A" && s[i] == "C" {
            aryACIndex.append(i)
        }
    }
    
    for _ in 1...q {
        let lr = readInts()
        let (l, r) = (lr[0] - 1, lr[1] - 1)
        var ans = 0
        for i in 0..<r {
            if aryACIndex[i] >= l && aryACIndex[i] <= r {
                ans += 1
            }
        }
        print(ans)
    }
}
main()
//  [typescript]
export class Main {
  static main(input): string {
    const tmp: string[] = input.split("\n");
    const [n, q]: number[] = tmp[0].split(" ").map(Number);
    const s: string = tmp[1];
    const acCountList: number[] = [];
    let prevA: boolean = false;
    let count: number = 0;
    for (let i = 0; i < n; i++) {
      const t: string = s.charAt(i);
      if (t == "A") {
        prevA = true;
      } else if (prevA) {
        if (t == "C") {
          ++count;
        }
        prevA = false;
      }
      acCountList.push(count);
    }
    const result: number[] = []
    for (let i = 2, len = q + 2; i < len; i++) {
      const [l, r]: number[] = tmp[i].split(" ").map(Number);
      result.push(acCountList[r - 1] - acCountList[l - 1]);
    }
    return `${result.join("\n")}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
const input = require("fs").readFileSync("/dev/stdin", "utf8").trim();

const lines = input.split('\n');
const [_, text, ...indexes] = lines;

const acMap = new Array(text.length);
let count = 0, prev = '', char = '', i = 0;
for (; i < text.length; i++) {
    if (text[i-1] === 'A' && text[i] === 'C') {
        count++;
    }
    acMap[i] = count;
}

const results = indexes.map((line) => {
    const [i, j] = line.split(' ').map(Number);
    return acMap[j - 1] - acMap[i - 1];
});

console.log(results.join('\n'));
//  [typescript]
function main(input) {
  input = input.trim().split("\n");
  const [n, q] = input[0].split(" ").map(n => Number(n));
  const s = input[1];
  const lr = input.slice(2).map(n => n.split(" ").map(m => Number(m));
  const arr = [s[0] === "A" && s[1] === "C" ? 1 : 0];
  for (let i = 1; i < s.length; i++) {
    const char = s[i];
    if (char === "A" && s[i+1] === "C") {
      arr.push(arr[i-1] + 1);
    } else {
      arr.push(arr[i-1]);
    }
  }
  const result = [];
  for (let i = 0; i < q; i++) {
    const [l, r] = lr[i];
    if (l === 1) {
      result.push(arr[r-2]);
    } else {
      result.push(arr[r-2]-arr[l-2]);
    }
  }
  console.log(result.join("\n"));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const ceil=(a)=>{return Math.ceil(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};const gcd=(x,y)=>{while(y){[x,y]=[y,x%y]}return x};const sum=(arr)=>{return arr.reduce((a,b)=>a+b);};const isPrime=(n:number):boolean=>{if(n<2)return false;const suq=Math.sqrt(n);for(let i=2;i<=suq;i++){if(n%i==0){return false;}}return true;};
const main=()=>{
  let [n,m]=tnn(2),s=ts()
  for(let i=0;i<m;i++){
    let ns=s.substring(tn()-1,tn()),next='A',c=0
    for(let j=0;j<ns.length;j++){
        if(ns[j]==next&&next=='A')next='C'
        else if(ns[j]==next){
            next='A'
            c++
        }
    }
    to(c)
  }
}
main()
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);let input_i=-1;const tn=():number=>{input_i++;return Number(input[input_i])};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{input_i++;return String(input[input_i])};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const ceil=(a)=>{return Math.ceil(a)};const asc=(ar:number[])=>{const t=[...ar];return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{const t=[...ar];return t.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length-1;i+=2){if(eval(a+op+arr[i])){return arr[i+1]}}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const deduplicate=(a:any[]):any[]=>{return Array.from(new Set(a))};const gcd=(x,y)=>{while(y){[x,y]=[y,x%y]}return x};const sum=(arr)=>{return arr.reduce((a,b)=>a+b);};const isPrime=(n:number):boolean=>{if(n<2)return false;const suq=Math.sqrt(n);for(let i=2;i<=suq;i++){if(n%i==0){return false;}}return true;};
const main=()=>{
  let [n,m]=tnn(2),s=ts()
  for(let i=0;i<m;i++){
      let ns=s.substring(tn()-1,tn()-1);
      to(ns)
  }
}
main()
//  [typescript]
function Main(input) {

  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var Q = parseInt(input[0].split(" ")[1]);
  var S = input[1];

  var l = Array(input.length-2);
  var r = Array(input.length-2);

  for(var i = 2; i < input.length; i ++){
    l[i-2] = parseInt(input[i].split(" ")[0]);
    r[i-2] = parseInt(input[i].split(" ")[1]);
  }

  var AtCoder = function(){
    this.dp = Array(N+1).fill(0);
  };

  AtCoder.prototype = {
    procedure: function(){
      for(let i = 0; i < N; i++){
        this.dp[i] = S.substring(0,i).split("AC").length -1;
      }
      this.dp[N] = this.dp[N-1];
      for(let i = 0; i < Q; i++){
        console.log(this.dp[r[i]]-this.dp[l[i]]);
      }
      return;
    }
  }
  var atcoder = new AtCoder();
  atcoder.procedure();
}

var input=require("fs").readFileSync("/dev/stdin", "utf8");
// var input=`8 3
// ACACTACG
// 3 7
// 2 3
// 1 8`
Main(input);
//  [python]
n=int(input())
for i in range(1,n+1):
    e=0
    for j in range(1,36):
        if(j*j>=n):
            break
        for k in range(1,36):
            if(k*k>=n):
                break
            for l in range(1,36):
                if(l*l>=n):
                    break
                if((j*j)+(k*k)+(l*l)+(j*k)+(k*l)+(l*j)==i):
                    e=e+1
    print(e)
//  [python]
n=int(input())
for i in range(1,n+1):
    e=0
    for j in range(1,51):
        if(j*j>=n):
            break
        for k in range(1,51):
            if(k*k>=n):
                break
            for l in range(1,51):
                if(l*l>=n):
                    break
                if((j*j)+(k*k)+(l*l)+(j*k)+(k*l)+(l*j)==i):
                    e=e+1
    print(e)
//  [python]
n=int(input())
for i in range(1,n+1):
    e=0
    for j in range(1,11):
        if(j*j>=n):
            break
        for k in range(1,11):
            if(k*k>=n):
                break
            for l in range(1,11):
                if(l*l>=n):
                    break
                if((j*j)+(k*k)+(l*l)+(j*k)+(k*l)+(l*j)==i):
                    e=e+1
    print(e)
//  [java]
import java.io.*;
import java.util.*;

public class Main{
	static void main() throws Exception{
		int n=sc.nextInt();
		int[]ans=new int[1000000];
		for(int x=1;x<=100;x++) {
			for(int y=1;y<=100;y++) {
				for(int z=1;z<=100;z++) {
					int idx=x*x+y*y+z*z+x*y+y*z+z*x;
					if(idx>=ans.length)continue;
					ans[idx]++;
				}
			}
		}
		for(int i=1;i<=n;i++) {
			pw.println(ans[i]);
		}
	}
	public static void main(String[] args) throws Exception{
		pw=new PrintWriter(System.out);
		sc = new MScanner(System.in);
		int tc=1;
//		tc=sc.nextInt();
		while(tc-->0)
			main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] ans = new int[N];

        long res = 0;
        long count=0;
        for(int i=1; i<Math.pow(N,0.5); i++){
            for(int j=1; j<Math.pow(N,0.5); j++){
                for(int l=1; l<Math.pow(N,0.5); l++){
                    res = i*i + j*j + l*l +i*j + j*l + l*i;
                    if(res<=N){
                        ans[(int)res-1]++;
                    }
                }
            }
        }

        for(int i=0; i<N; i++){
            System.out.println(ans[i]);
        }
        System.out.println(count);
        
        }
    }
//  [java]
import java.util.*;
import java.io.*;
import java.math.*;
public class Main{
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		PrintWriter ou = new PrintWriter(System.out);
		int n = Integer.parseInt(sc.next());
		sc.close();
		for(int i = 1 ; i <= n ; i++){
			int yono = 0;
			for(int a = 1 ; a <= Math.sqrt(n) ; a++){
				for(int b = 1 ; b <= Math.sqrt(n) ; b++){
					for(int c = 1 ; c <= Math.sqrt(n) ; c++){
						if(i == a * a + b * b + c * c + a * b + b * c + c * a) yono++;
					}
				}
			}
			ou.println(yono);
		}
		ou.flush();
	}
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		//上限値検索
		for (int i = 1; i <= N; i++) {
			int n = i;
			int max = (int) Math.floor(Math.sqrt((double) n));
			int check = 0;
			for (int s = 1; s <= max; s++) {
				for (int t = 1; t <= max; t++) {
					for (int u = 1; u <= max; u++) {
						if(s * s + t * t + u * u + s * t + t * u + u * s > n) {
							break;
						}
						if (s >= t && t >= u && s * s + t * t + u * u + s * t + t * u + u * s == n) {
							if (s != t & t != u && u != s) {
								check += 6;
							} else if (s == t && t == u && u == s) {
								check++;
							} else {
								check += 3;
							}
						}
					}
				}
			}
			System.out.println(check);
		}
	}

}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int f(int x, int y, int z) {
	return x*x + y*y + z*z + x*y + y*z + z*x;
}

int main() {
	int n;

	cin >> n;

	vector <int> ans(n+1, 0);

	for (int x = 1; x <= n && f(x, 1, 1) <= n; x++) {
		for (int y = x; y <= n && f(x, y, 1) <= n; y++) {
			for (int z = y; z <= n && f(x, y, z) <= n; z++) {
				int w = f(x, y, z);

				// cout << x << " " << y << " " << z << " " << w << "\n";

				if (x == y && y == z)
					ans[w]++;
				else if (x == y || y == z || x == z)
					ans[w] += 3;
				else
					ans[w] += 6;
			}
		}
	}

	for (int i = 1; i <= n; i++) {
		cout << ans[i] << "\n";
	}

	return 0;
}
//  [cpp]
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;
 
#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  f              first                 
#define  s              second
#define  endl           "\n"
#define  pb             push_back  
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" ";cout<<endl;
#define  deb1(a)        cout<<a<<endl;
#define  deb2(a,b)      cout<<a<<" "<<b<<endl;
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<endl;
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;            
 
typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  unordered_map<ll,ll>  um;
typedef  vector<pll>           vpll;
 
const ll   N     =  3e5+5;
const ll   mod   =  1e9+7;
const ll   INF   =  1e18;
const int  INFi  =  0x7f7f7f7f;

ll test = 1, n, ans[N];

void solve(){
	cin>>n;
	for(int i = 1; i*i < n; i++){
		for(int j = 1; j*j < n; j++){
			for(int k = 1; k*k < n; k++){
				ll x = i*i+j*j+k*k+i*j+i*k+j*k;
				if(x > n) break;
				ans[x]++;
			}
		}
	}
	for(int i = 1; i <= n; i++) deb1(ans[i])
}

int main(){
	fastio;
	//cin>>test;
	for(int i = 1; i <= test; i++){
		solve();
	}
}
//  [cpp]
#include <bits/stdc++.h>

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (n - 1); i > (a - 1); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto i = (x).rbegin(); i != (x).rend(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1LL << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define Unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) (((n) * ((n) + 1)) / 2)
#define updiv(a, b) ((a + b - 1) / b)
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class A, class B>
bool chmax(A &a, const B &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A, class B>
bool chmin(A &a, const B &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, 1, 1, -1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

signed main(void) {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int n;
  cin>>n;
  vector<int> ans(1000010,0);

  rep(i,1,110){
    rep(j,1,110){
      rep(k,1,110){
//  [cpp]
#include <stdio.h>
#pragma warning (disable:4996)

//prototype
int counter(int);

int main() {
	//input
	int N;
	(void)scanf("%d", &N);

	//output
	for (int i = 1; i <= N; i++) {
		printf("%d\n", counter(i));
	}
}

int counter(int i) {
	int count = 0;
	for (int x = 1; x * x < i; x++) {
		for (int y = 1; y * y < i - (x * x); y++) {
			for (int z = 1; z * z < i - (x * x) - (y * y); z++) {
				if (((x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x)) == i)count++;
			}
		}
	}
	return count;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 10;
int n, ans[N];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	cin >> n;

	for (int x = 1; x * x <= n; x++) {
		for (int y = 1; y * y <= n; y++) {
			for (int z = 1; z * z <= n; z++) {
				int f = 0;
				f += x * x + y * y + z * z;
				f += x * y + y * z + z * x;
				ans[f] += 1;
			}
		}
	}

	for (int i = 1; i <= n; i++) {
		cout << ans[i] << '\n';
	}

	return 0;
}
//  [c]
#include <stdio.h>
int main(void){
  int n;
  scanf("%d", &n);
  int i, x, y, z, c[10001] = {0};
  for(x=1; x<=100; x++){
    for(y=1; y<=100; y++){
      for(z=1; z<=100; z++){
        int f = x*x+y*y+z*z+x*y+y*z+z*x;
        if(f < 10001){
          c[f]++;
        }
      }
    }
  }

  for(i=1;i<=n;i++){
    printf("%d\n", c[i]);
  }
  return 0;
}
//  [c]
//AC
#include <stdio.h>


int main(void){

    int N;
    scanf("%d",&N);

    for(int n=1;n<=N;n++){ 
        int count=0;

        for(int i=1;i*i+2*i<=n;i++){
            for(int j=1;j*j+2*j<=n&&j<=i;j++){
                for(int k=1; k*k+2*k<=n&&k<=j;k++){
                    if(i*i+j*j+k*k+i*j+j*k+k*i==n){
                        if(i==j&&i==k){count++;}
                        else if(i!=j&&j!=k&&k!=i){count+=6;}
                        else{count+=3;}
                }
            }
        }
        printf("%d\n",count);
    }
        
    }

}
//  [c]
//AC
#include <stdio.h>


int main(void){

    int N;
    scanf("%d",&N);

    for(int n=1;n<=N;n++){ 
        int count=0;

        for(int i=1;i*i+2*i<=n;i++){
            for(int j=1;j*j+2*j<=n&&j<=i;j++){
                for(int k=1; k*k+2*k<=n&&k<=j;k++){
                    if(i*i+j*j+k*k+i*j+j*k+k*i==n){
                        if(i==j&&i==k){count++;}
                        else if(i!=j&&j!=k&&k!=i){count+=6;}
                        else{count+=3;}
                }
            }
        }
        printf("%d\n",count;
    }
        
    }

}
//  [c]
#include <stdio.h>

int main() {
    
    int a, i, x, y, z;
    int res[100001] = {};
    
	scanf("%d", &a);
    
	for (x = 1; x * x + 2 * x < a; x++) {
        for (y = 1; y * y + 2 * y < a; y++) {
            for (z = 1; z * z + 2 * z < a; z++) {
                res[x * x + y * y + z * z + x * y + y * z + z * x]++;
            }
        }
    }
    
	for (i = 1; i < a; i++) {
        printf("%d\n", res[i]);
	}
        
	return 0;
}
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var n = next();
  var ans = xArray(0,n);
  for(var x = 1; x*x <= n; x++){
    for(var y = 1; y*y <= n; y++){
      var xy = x*x + y*y + x*y;
      if(xy > n)break;
      for(var z = 1; z*z <= n; z++){
        var f = xy + z*z + y*z + z*x;
        if(f > n)break;
        ans[f-1]++;
      }
    }
  }
  return ans.join("\n");
}
//  [javascript]
"use strict"

const { sign } = require("crypto");

const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function () { return this.index < this.max },
        "next": function () { if (!this.hasNext()) { throw "ArrayIndexOutOfBoundsException"; } else { return this.list[this.index++]; } }
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)

const Main = () => {
    let n = nextInt()
    let a = new Array(n).fill(0)
    for (let x = 1; x * x < n; x++) {
        for (let y = 1; y * y < n; y++) {
            for (let z = 1; z * z < n; z++) {
                const sum = x * x + y * y + z * z + x * y + y * z + z * x;
                if (sum > n) break;
                a[sum - 1]++;
            }
        }
    }
    console.log(a.join(`\n`))
}
Main()
//  [javascript]
var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split("\n");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(" ").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();
var o = GET(require("fs").readFileSync("/dev/stdin", "utf8"));

console.log(main());
function main(){
    var N = +o.getValue(0);

    var result = Array(N).fill(0);
    for(var x = 1; 100 > x; x++) {
        for(var y = 1; 100 > y; y++) {
            for(var z = 1; 100 > z; z++) {
                var n = x**2 + y**2 + z**2 + x*y + x*z + y*z;
                if (N >= n) {
                    result[n - 1] += 1;
                }
            }
        }
    }

    return result.join('\n');
}
//  [javascript]
function Main(input) {
	n = input
	for (i=1;i<=(n);i++){
		var cnt=0;
		for (x=1; x <= 100; x++){
			for (y=1; y<=100; y++){
				for (z=1; z<=100; z++){
					var eq = x**2 + y**2 + z**2 + x*y + y*z + z*x;
					if (eq === i){
						cnt++;
					}
				}
			}
		}
		console.log(cnt)
	}

}


// var input = "20";

// Main(input);

// *この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	n = input
	for (i=1;i<=(n);i++){
		var cnt=0;
		for (x=1; x <= 100; x++){
			for (y=1; y<=100; y++){
				for (z=1; z<=100; z++){
					var eq = x**2 + y**2 + z**2 + x*y + y*z + z*x;
					if (eq === i){
						cnt++;
					}
				}
			}
		}
		console.log(cnt)
	}

}


// var input = "20";

Main(input);

// *この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
//let input = "20";

function main(input){
  input = input.trim();
  let n = parseInt(input);
  let count = 0;
  for(let i = 1; i<=n; i++){
    count = 0;
    let kaisuu = Math.floor(Math.sqrt(i));
    for(let x = 1; x<=kaisuu+1; x++){
      for(let y = 1; y<=kaisuu+1; y++){
        for(let z = 1; z<=kaisuu+1; z++){
          if(x*x+y*y+z*z+x*y+y*z+z*x===i){
            count++;
          }
        }//z
      }//y
    }//x
    console.log(count);
  }//i
}
//main(input);
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

// Solution for https://atcoder.jp/contests/aising2020/tasks/aising2020_c

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var n int
	con.Scan(&n)
	a := make([]int, n+1)
	for x := 1; x <= n; x++ {
		p := x * x
		if p > n {
			break
		}
		for y := 1; y <= n; y++ {
			q := p + y*y + x*y
			if q > n {
				break
			}
			for z := 1; z <= n; z++ {
				r := q + z*z + y*z + z*x
				if r > n {
					break
				}
				a[r]++
			}
		}
	}
	for i := 1; i <= n; i++ {
		con.Println(a[i])
	}
	return nil
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var n int
	fmt.Scan(&n)

	ans := make([]int, n+1)
	idx := 1
	for ; idx*idx <= n; idx++ {
		x := idx
		for y := 1; x*x+y*y <= n; y++ {
			for z := 1; x*x+y*y+z*z <= n; z++ {
				if v := x*x + y*y + z*z + x*y + y*z + z*x; v <= n {
					ans[v]++
				}
			}
		}
	}

	wr := bufio.NewWriter(os.Stdout)
	for _, v := range ans[1:] {
		wr.WriteString(strconv.Itoa(v) + "\n")
	}
	wr.Flush()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	/*/TODO:!!!!!!!テスト用!!!!!!!!!
	sc = bufio.NewScanner(strings.NewReader(`
										`))
	//TODO:!!!!!!!テスト用!!!!!!!!!*/

	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	//fmt.Fprintln(out, "[DEBUG]", time.Now())

	n := nextInt()
	f := make([]int, n+1)

	nf := func(x int, y int, z int) int {
		return x*x + y*y + z*z + x*y + y*z + z*x
	}

	xf := true
	for x := 1; xf; x++ {
		xf = false
		yf := true
		for y := 1; yf; y++ {
			nw := 0
			yf = false
			for z := 1; nw <= n; z++ {
				nw = nf(x, y, z)
				if nw <= n {
					xf = true
					yf = true
					f[nw]++
				}
			}
		}
	}
	for i := 1; i <= n; i++ {
		fmt.Fprintln(out, f[i])
	}

	//fmt.Fprintln(out, "[DEBUG]", a)
	//fmt.Fprintln(out, ans)

}

//------------------------------------------------------------------------------

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

func printArray(a []int) {
	for i := 0; i < len(a); i++ {
		if i >= 1 {
			fmt.Fprint(out, " ")
		}
		fmt.Fprint(out, a[i])
	}
	fmt.Fprintln(out)
}

func absInt(x int) int {
	return int(math.Abs(float64(x)))
}
func minInt(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func maxInt(x, y int) int {
	if x > y {
		return x
	}
	return y
}
func log10(x int) float64 {
	return math.Log10(float64(x))
}

// 挿入ソート配列
type slist struct {
	l []int
}

func makeSlist() slist {
	return slist{[]int{}}
}

func (s *slist) add(a int) {
	pos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })
	if pos < len(s.l) {
		s.l = append(s.l[:pos+1], s.l[pos:]...)
		s.l[pos] = a
	} else {
		s.l = append(s.l, a)
	}
}
func (s slist) contains(a int) bool {
	pos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })
	return pos < len(s.l) && s.l[pos] == a
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, 10010)
	for x := 1; x <= 100; x++ {
		for y := 1; y <= 100; y++ {
			for z := 1; z <= 100; z++ {
				v := x*x + y*y + z*z + x*y + y*z + z*x
				if v <= 10000 {
					a[v]++
				}
			}
		}
	}
	for i := 0; i < N; i++ {
		fmt.Println(a[i])
	}
}
//  [go]
package main

import "fmt"

func f(n int) int {
	var ret int
	for x := 1; x <= 100; x++ {
		if x*x <= n {
			for y := 1; y <= 100; y++ {
				if x*x+y*y+x*y <= n {
					for z := 1; z <= 100; z++ {
						if x*x+y*y+z*z+x*y+y*z+z*x == n {
							ret++
						}
					}
				}
			}
		}
	}
	return ret
}

func main() {
	var N int
	fmt.Scan(&N)
	for i := 1; i <= N; i++ {
		fmt.Println(f(i))
		// fmt.Println(i, f(i))
	}
}
//  [go]
package main

import "fmt"

func f(n int) int {
	var ret int
	for x := 1; x <= 100; x++ {
		for y := 1; y <= 100; y++ {
			for z := 1; z <= 100; z++ {
				if n == x*x+y*y+z*z+x*y+y*z+z*x {
					ret++
				}
			}
		}
	}
	return ret
}

func main() {
	var N int
	fmt.Scan(&N)
	for i := 1; i <= N; i++ {
		fmt.Println(f(i))
		// fmt.Println(i, f(i))
	}
}
//  [ruby]
N = gets.to_i

F = lambda{|x,y,z| x*x+y*y+z*z+x*y+y*z+z*x }
Fn = [0]*(N+1)

x=y=z=1
until N < n=F[x,x,x]
	Fn[n] += 1
	z = x+1
	until N < n=F[x,x,z]
		Fn[n] += 3
		z += 1
	end
	y = x+1
	until N < n=F[x,y,y]
		Fn[n] += 3
		z = y+1
		until N < n=F[x,y,z]
			Fn[n] += 6
			z += 1
		end
		y += 1
	end
	x += 1
end

puts Fn.drop 1
//  [ruby]
n = gets.to_i
arr = Array.new(n + 1) { 0 }

1.upto(100) do |x|
  x.upto(100) do |y|
    y.upto(100) do |z|
      f = (x + y + z)**2 - x * y - y * z - z * x
      break if f > n

      if x == y && y == z
        arr[f] += 1
      else
        arr[f] += (x != y && y != z) ? 6 : 3
      end
    end
  end
end

puts arr.drop(1)
//  [ruby]
N = gets.to_i

ans = Array.new(N, 0)
1.step(100) do |x|
  x.step(100) do |y|
    y.step(100) do |z|
      n = x**2 + y**2 + z**2 + x*y + y*z + z*x
      break if N < n
      ans[n - 1] += 
        case
        when x == y && x == z then 1
        when x != y && y != z then 6
        else ;                   ; 3
        end
    end
  end
end

puts ans
//  [ruby]
n=gets.to_i

n.times.each do |k|
    k=k+1
    if k<6
        p 0
        next
    end
    v=[*1..k**0.3]
    array=v.repeated_permutation(3).to_a

    count=0
    for j in 0..array.length-1
        if array[j][0]**2+array[j][1]**2+array[j][2]**2+array[j][0]*array[j][1]+array[j][0]*array[j][2]+array[j][2]*array[j][1]==k
            count+=1
        end
    end
       
    p count
end
//  [ruby]
n=gets.to_i

n.times.each do |k|
    k=k+1
    if k<6
        p 0
        next
    end
    v=[*1..k**0.5]
    array=v.repeated_permutation(3).to_a

    count=0
    for j in 0..array.length-1
        if array[j][0]**2+array[j][1]**2+array[j][2]**2+array[j][0]*array[j][1]+array[j][0]*array[j][2]+array[j][2]*array[j][1]==k
            count+=1
        end
    end
       
    p count
end
//  [ruby]
num = gets.chomp.to_i
# num = 20 
# 入力値を受けとる



(1..num).each do |n|

    result_count = 0


    pre_arr_x = (1..n).to_a
    pre_arr_y = (1..n).to_a
    pre_arr_z = (1..n).to_a

    total_arr = pre_arr_x.product(pre_arr_y, pre_arr_z)
    # 全ての組み合わせを一つの配列に格納してくれる

    
    total_arr.each do |a|
        x = a[0]
        y = a[1]
        z = a[2]

        if (x + y + z) ** 2 - (x * y + y * z + z * x) === n
            result_count += 1
        end

    end

    p result_count

end
//  [rust]
use proconio::*;

#[fastout]
fn main() {
    input! {
        n: usize,
    };
    let mut ans = [0; 10001];

    for x in 1..=100 {
        for y in x..=100 {
            for z in y..=100 {
                let t = x * x + y * y + z * z + x * y + y * z + x * z;
                if t <= n {
                    ans[t] += if x == y && y == z {
                        1
                    } else if x == y || y == z || x == z {
                        3
                    } else {
                        6
                    };
                }
            }
        }
    }

    for a in &ans[1..=n] {
        println!("{}", a);
    }
}
//  [rust]
use proconio::{input,fastout};

fn f(x: usize, y: usize, z: usize) -> usize {
    x*x + y*y + z*z + x*y + y*z + z*x
}

#[fastout]
fn main() {
    input! {
        n: usize
    }
    let mut v = vec![0; n];
    for i in 1..n {
        if i*i > n { break; }
        for j in 1..n {
            if j*j > n { break; }
            for k in 1..n {
                if k*k > n { break; }
                let m = f(i,j,k);
                if m <= n { v[m-1] += 1; }
                else { break; }
            }
        }
    }
    for &x in &v { println!("{}", x) }
}
//  [rust]
use proconio::{input, fastout};

fn main() {
  input!{
    n: i64
  }
  for i in 1..=n {
    let mut ans = 0;
      for x in 1..n {
          for y in x..n {
              for z in y..n {
                  if x*x + y*y + z*z + x*y + y*z + z*x == i {
                      if x == y && y == z && z == x {
                        ans += 1;
                      }else if x != y && y != z && z != x {
                        ans += 6;
                      }else{
                        ans += 3;
                      }
                  }
              }
          }
      }
    println!("{}",ans);
  }  
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {n: usize};

    let mut result: Vec<usize> = vec![0; n];
    let mut v: Vec<usize> = vec![0; 3];

    dfs(&mut v, &mut result, 0, n)
}

fn dfs(v: &mut Vec<usize>, result: &mut Vec<usize>, index: usize, n: usize) {
    if index == 3 {
        let sum = v[0] * v[0] + v[1] * v[1] + v[2] * v[2] + v[0] * v[1] + v[1] * v[2] + v[2] * v[0];

        // 20↓
        if sum <= n {
            // 1 -> 20
            for i in 1..n + 1 {
                if sum == i {
                    result[i - 1] += 1;
                    break;
                }
            }
        }
    } else {
        let x = (n as f64).sqrt() as usize + 1;
        for i in 1..x {
            v[index] = i;
            dfs(v, result, index + 1, n);
        }
    }
}
//  [rust]
use proconio::*;

#[fastout]
fn main() {
    input! {
        n: usize,
    };

    let mut ans = vec![0; n + 1];

    for i in 1..n {
        for x in 1..100 {
            for y in 1..100 {
                for z in 1..100 {
                    let t = x * x + y * y + z * z + x * y + y * z + x * z;
                    if t == i {
                        ans[i] += 1;
                    }
                }
            }
        }
    }
    for a in &ans {
        println!("{}", a);
    }
}
//  [swift]
func readInt() -> Int {
    return Int(readLine()!)!
}

func result(x: Int, y: Int, z: Int) -> Int {
    return x*x + y*y + z*z + z*y + x*y + x*z
}

func mainC() {
    let N = readInt()

    var score = (0...N).map { _ in return 0 }

    let max = 100
    for i in 1...max {
        for j in 1...max {
            for k in 1...max {
                let res = result(x: i, y: j, z: k)
                if res < score.count {
                    score[res] += 1
                }
            }
        }
    }

    for n in 1...N {
        print(score[n])
    }

}

mainC()
//  [swift]
import Foundation
func C() {
    let N = Int(readLine()!)!
    let MAX = 100
    var memo = Array(repeating: 0, count: N+1)
    for x in 1...MAX{
        for y in 1...MAX{
            for z in 1...MAX{
                let a = pow(Double(x), 2.0) + pow(Double(y), 2.0) + pow(Double(z), 2.0)
                let b = x*y + y*z + z*x
                let c = Int(a) + b
                if c > N {
                    continue
                }
                memo[c] += 1
            }
        }
    }
    for i in 1...N{
        print(memo[i])
    }
}

C()
//  [swift]
let n = Int(readLine()!)!
var list = Array(repeating: 0, count: n+1)
for x in 1...n {
    guard x*x <= n else { break }
    for y in 1...n {
        guard x*x+y*(x+y) <= n else { break }
        for z in 1...n {
            let i = x*x+y*(x+y)+z*(x+y+z)
            guard i <= n else { break }
            list[i] += 1
        }
    }
}
for i in 1...n {
    print(list[i])
}
//  [swift]
import Foundation

let input_N = Int(readLine()!)!
var counts = [Int](repeating: 0, count: input_N)
// x+y ^2 + y+z ^2 + z+x ^2 = 2n
let min = Int(sqrt(Double(input_N) / 6.0))
let max = Int(sqrt(Double(input_N)))

for it in 1...input_N {
    // x >= y >= z
    for x in min...max {
        for z in 1...min {
            for y in z...x {
                if x*x + y*y + z*z + x*y + y*z + z*x == it {
                    if x == y && y == z {
                        counts[it-1] += 1
                    } else if x == y || y == z {
                        counts[it-1] += 3
                    } else {
                        counts[it-1] += 6
                    }
                }
            }
        }
    }
}

counts.forEach {print($0)}
//  [swift]
import Foundation

let input_N = Int(readLine()!)!
var counts = [Int](repeating: 0, count: input_N)
let max = Int(sqrt(Double(input_N - 5)))

for it in 1...input_N {
    // x >= y >= z
    for x in 1...max {
        for y in 1...x {
            for z in 1...y {
                if x*x + y*y + z*z + x*y + y*z + z*x == it {
                    if x == y && y == z {
                        counts[it-1] += 1
                    } else if x == y || y == z {
                        counts[it-1] += 3
                    } else {
                        counts[it-1] += 6
                    }
                }
            }
        }
    }
}

counts.forEach {print($0)}
//  [swift]
import Foundation

let input_N = Int(readLine()!)!
var counts = [Int](repeating: 0, count: input_N)
// x+y ^2 + y+z ^2 + z+x ^2 = 2n
let min = Int(sqrt(Double(input_N) / 6.0))
let max = Int(sqrt(Double(input_N - 5)))

for it in 6...input_N {
    // x >= y >= z
    for x in min...max {
        for y in 1...x {
            for z in 1...y {
                if x*x + y*y + z*z + x*y + y*z + z*x == it {
                    if x == y && y == z {
                        counts[it-1] += 1
                    } else if x == y || y == z {
                        counts[it-1] += 3
                    } else {
                        counts[it-1] += 6
                    }
                }
            }
        }
    }
}

counts.forEach {print($0)}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = Number(input[0][0]);

  const T: { [key: number]: number | undefined } = {};

  for (let x = 1; x * x <= N; x++) {
    for (let y = 1; y * y <= N; y++) {
      for (let z = 1; z * z <= N; z++) {
        const n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x;

        T[n] = (T[n] || 0) + 1;
      }
    }
  }

  const F: number[] = [];

  for (let i = 1; i <= N; i++) {
    F.push(T[i] || 0);
  }

  return F.join("\n");
};

console.log(main(read()));