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: Accepted

Solution code:
# coding: utf-8
#import numpy as np
import re
import math
from collections import defaultdict,deque,Counter
from fractions import Fraction
import bisect
import itertools
from itertools import accumulate
from copy import deepcopy
import heapq
import random
import time
import os
import sys
from functools import lru_cache,reduce
readline=sys.stdin.readline
sys.setrecursionlimit(100000)
alp="abcdefghijklmnopqrstuvwxyz"
numbers="0123456789"
mod=int(10**9+7)
inf=int(10**19)
class Set():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(bool)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        if not self.find(x):
            heapq.heappush(self.heap,x)
            self.dic[x]=True
            self.size+=1

    def remove(self,x):
        if self.find(x):
            self.dic[x]=False
            self.size-=1

    def find(self,x):
        return self.dic[x]
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==False:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class multiset():
    def __init__(self,A=[]):
        self.heap=[]
        self.dic=defaultdict(int)
        self.size=0
        for a in A:self.add(a)
    
    def __str__(self):
        return str(self.heap)
    
    def add(self,x):
        heapq.heappush(self.heap,x)
        self.dic[x]+=1
        self.size+=1

    def remove(self,x):
        if self.dic[x]>0:
            self.dic[x]-=1
            self.size-=1
    
    def count(self,x):
        return self.dic[x]

    def find(self,x):
        return self.dic[x]>0
    
    def top(self):
        while self.heap and self.dic[self.heap[0]]==0:
            heapq.heappop(self.heap)
        if self.heap:return self.heap[0]
        else:return None

    def pop(self):
        ret=None
        if self.heap:
            ret=self.top()
            self.remove(ret)
        return ret
class Edge():
    def __init__(self,x,y,val=1):
        self.x=x
        self.y=y
        self.val=val
class unionfind():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(n)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):
            self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def yn(b):print("yes" if b else "no")
def Yn(b):print("Yes" if b else "No")
def YN(b):print("YES" if b else "NO")
def ispow(a,b):
    now=b
    while now<a:
        now*=b
    return now==a
def getbin(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def getfacs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod_>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def nextcomb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:return num
def getprimes(n):
    if n==0:return []
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    ret=[]
    for a in range(n+1):
        if(A[a]):ret.append(a)
    return ret
def isprime(num):
    if(num<=1):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(b,t,f):return t if b else f
def factorize(n):
    b = 2
    ret=defaultdict(int)
    while b * b <= n:
        while n % b == 0:
            n //= b
            ret[b]+=1
        b+=1
    if n > 1:ret[n]+=1
    return ret
def inputintlist(row=1): 
    if row==1:
        ret=list(map(int,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=int(input())
    return ret
def inputfloatlist(row=1): 
    if row==1:
        ret=list(map(float,input().split()))
    else:
        ret=[None]*row
        for a in range(row):
            ret[a]=float(input())
    return ret
def istanchouzouka(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>=a:
            f=False
        prev=a
    return f
def istanchouhigensyou(A):
    f=True
    prev=min(A)-1
    for a in A:
        if prev>a:
            f=False
        prev=a
    return f
def getallsum(A):
    s=sum(A)
    dp=defaultdict(int)
    dp[0]=1
    for a in range(0,len(A)):
        for b in range(s,-1,-1):
            if b-A[a]>=0:
                dp[b]+=dp[b-A[a]]
    return dp
def yuukoutomukou(edges):
    ret=deepcopy(edges)
    for edge in edges:
        if not edge.x==edge.y:
            ret.append(Edge(edge.y,edge.x,edge.val))
    return ret
def dijkstra(edges,V,start):
    mincost=[inf]*V
    G=[[] for a in range(V)]
    for edge in edges:
        G[edge.x].append([edge.val,edge.y])
    Q=PriorityQueue()
    Q.put([0,start])#[cost,x]
    while not Q.empty():
        nowcost,nowx=Q.get()
        if mincost[nowx]==inf:
            mincost[nowx]=nowcost
            for cost,y in G[nowx]:
                newcost=nowcost+cost
                Q.put([newcost,y])
    return mincost
def warshallfloyd(edges,V):
    mincost=[[inf for b in range(V)] for a in range(V)]
    for a in range(V):mincost[a][a]=0
    for edge in edges:
        mincost[edge.x][edge.y]=min(mincost[edge.x][edge.y],edge.val)#x→yが複数ある場合のためにmin()する
    for k in range(V):
        for s in range(V):
            for t in range(V):
                if mincost[s][k]==inf or mincost[k][t]==inf:continue
                mincost[s][t]=min(mincost[s][t],mincost[s][k]+mincost[k][t])
    return mincost
def bellemanford(edges,V,start):
    mincost=[inf]*V
    mincost[start]=0
    for _ in range(V):
        for edge in edges:
            if mincost[edge.x]==inf:continue
            mincost[edge.y]=min(mincost[edge.y],mincost[edge.x]+edge.val)
    return mincost
def getmd(x1,y1,x2,y2):return abs(x1-x2)+abs(y1-y2)
def geted(x1,y1,x2,y2):return math.sqrt((x1-x2)**2+(y1-y2)**2)
class fordfulkerson():
    def __init__(self,edges,V,s,t):
        self.V=V
        self.used=[False]*V
        self.G=[[] for a in range(V)]
        self.s=s
        self.t=t
        for edge in edges:
            self.G[edge.x].append({"x":edge.x,"y":edge.y,"cap":edge.val,"rev":len(self.G[edge.y])})
            self.G[edge.y].append({"x":edge.y,"y":edge.x,"cap":0,"rev":len(self.G[edge.x])-1})
    def dfs(self,v,t,f=inf):
        if v==t:return f
        self.used[v]=True
        for a in range(len(self.G[v])):
            x=self.G[v][a]["x"]
            y=self.G[v][a]["y"]
            cap=self.G[v][a]["cap"]
            rev=self.G[y][self.G[x][a]["rev"]]
            if self.used[y] or cap==0:continue
            f2=self.dfs(y,t,min(f,cap))
            if f2>0:
                self.G[v][a]["cap"]-=f2
                rev["cap"]+=f2
                return f2
        return 0
    def maxflow(self):
        flow=0
        while True:
            self.used=[False]*V
            zouka=self.dfs(self.s,self.t)
            if zouka==0:break
            flow+=zouka
        return flow
def zipsort(*args):
    ziplist=sorted(zip(*args))
    for a in range(len(args)):
        for b in range(len(ziplist)):
            args[a][b]=ziplist[b][a]
def zipreverse(*args):
    ziplist=list(zip(*args))
    rev=[]
    for a in range(len(ziplist)-1,-1,-1):
        rev.append(ziplist[a])
    for a in range(len(args)):
        for b in range(len(rev)):
            args[a][b]=rev[b][a]

######################################################################################################


N=int(input())
F=[0]*(10**5)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            num=x**2+y**2+z**2+x*y+y*z+z*x
            F[num]+=1
for a in range(1,N+1):
    print(F[a])

Submission status: Accepted

Solution code:

n = int(input())
buf = [0 for i in range(100000)]

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            tp = i*i+j*j+k*k+i*j+j*k+k*i
            buf[tp] += 1

for i in range(n):
    print(buf[i+1])

Submission status: Accepted

Solution code:
from collections import defaultdict
n=int(input())
dic=defaultdict(int)
for x in range(1,100,1):
    for y in range(1,100,1):
        for z in range(1,100,1):
            temp=x**2+y**2+z**2+x*y+y*z+z*x
            dic[temp]+=1
for i in range(n):  print(dic[i+1])

Submission status: Accepted

Solution code:
N = int(input())

def f(a, b, c):
    return a**2 + b**2 + c**2 + a*b + b*c + c*a

ans = [0] * N

for x in range(1, 101):
    for y in range(x, 101):
        for z in range(y, 101):
            p = f(x, y, z)
            if (p <= N):
                if (x == y and y == z):
                    ans[p-1] += 1
                elif (x == y or y == z or z == x):
                    ans[p-1] += 3
                else:
                    ans[p-1] += 6

for a in ans:
    print(a)

Submission status: Accepted

Solution code:
"""
                            pppppppppppppppppppp
                         ppppp  ppppppppppppppppppp
                      ppppppp    ppppppppppppppppppppp
                      pppppppp  pppppppppppppppppppppp
                      pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
       ppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppp
      pppppppppppppppppppppppppppppppppppppppppppppppp  ppppppppppppppppppppp
     ppppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppppp
    ppppppppppppppppppppppppppppppppppppppppppppppp    pppppppppppppppppppppppp
   pppppppppppppppppppppppppppppppppppppppppppppp     pppppppppppppppppppppppppp
  ppppppppppppppppppppppppppppppppppppppppppppp      pppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppppppp               pppppppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppp     pppppppppppppppppppppppppppppppppppppppppppppp
  ppppppppppppppppppppppppppp    pppppppppppppppppppppppppppppppppppppppppppppppp
    pppppppppppppppppppppppp  pppppppppppppppppppppppppppppppppppppppppppppppppp
     ppppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppppp
      pppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppp
       ppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
                              pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppp  pppppppp
                              ppppppppppppppppppppp    ppppppp
                                 ppppppppppppppppppp  ppppp
                                    pppppppppppppppppppp
"""


import sys
from collections import Counter as C
def data(): return sys.stdin.readline().strip()
def out(var): sys.stdout.write(str(var))
def outa(*var, end="\n"): sys.stdout.write(' '.join(map(str, var)) + end)


d = C()
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            d[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i] += 1
n = int(data())
for i in range(1, n+1):
    out(str(d[i])+"\n")

Submission status: Accepted

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

n = int(input())

cnt = {}
for x in range(1, 101):
    for y in range(1, 101):
        if(f(x, y, 1) > n): break
        for z in range(1, 101):
            if(f(x, y, z) > n): break
            
            val = f(x, y, z)

            if(cnt.get(val) is None): cnt[val] = 1
            else: cnt[val] += 1

for i in range(1, n+1):
    if(cnt.get(i) is None): print(0)
    else: print(cnt[i])

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# import numpy as np
# sys.setrecursionlimit(int(pow(10,6)))
# sys.stdout = open("out.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

try:
    sys.stdin = open("input.txt", "r")
except:
    pass


# @lru_cache(None)
n=L()[0]
dp=[0 for i in range(n+1)]
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            val=i*i+j*j+k*k+i*j+i*k+j*k
            if val<=n:
                dp[val]+=1
for i in range(1,n+1):
    print(dp[i])

Submission status: Accepted

Solution code:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file=0




def f(x,y,z):
    return (x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(z*x)
def solve():


    # for _ in range(ii()):
    
        

    n=ii()
    ans=[0]*(n+1)
    for i in range(1,n+1):
        for j in range(1,n+1):
            if f(i,j,1)>n:
                break
            for k in range(1,n+1):
                x=f(i,j,k)
                if x>n:
                    break
                ans[x]+=1

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





        
if __name__ =="__main__":

    if(file):

        if path.exists('input1.txt'):
            sys.stdin=open('input1.txt', 'r')
            sys.stdout=open('output1.txt','w')
        else:
            input=sys.stdin.readline
    solve()

Submission status: Accepted

Solution code:
N=int(input())
a=[0]*(N+1)
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            t=x**2+y**2+z**2+x*y+y*z+z*x
            if t<=N:
                a[t]+=1
for i in a[1:]:
    print(i)

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*10**7
for i in range(1,5*10**2):
    for j in range(1,5*10**2):
        for k in range(1,5*10**2):
            ans[(i+j+k)**2-(i*j+j*k+k*i)] += 1
for i in ans[1:n+1]:
    print(i)

Submission status: Accepted

Solution code:
n = int(input())
a = [0 for i in range(10000)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            w = (x+y+z)**2-z*x-z*y-x*y
            if w <= 10000:
                a[w-1] += 1
for i in range(n):
    print(a[i])

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
ans = [0]*n

for x in range(1,101):
    for y in range(x,101):
        for z in range(y,101):
            p = 3 if x==y else 6
            if y==z:
                p = 1 if p==3 else 3
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k <= n:
                ans[k-1] += p

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = [0]*(n+1)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if tmp <= n:
                    ans[tmp] += 1
    for i in range(1, n+1):
        print(ans[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
import copy
# from fractions import gcd

MOD = 10 ** 9 + 7
# MOD = 998244353
# sys.setrecursionlimit(10**8)


n = int(input())
ans = [0]*(n+1)

for a in range(1, 100):
    for b in range(1, 100):
        for c in range(1, 100):
            num = a*a + b*b + c*c + a*b + b*c + c*a
            if num <= n:
                ans[num] += 1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    fc = Counter()
    for x in range(1, 100+1):
        x2 = x**2
        for y in range(1, 100+1):
            y2 = y**2
            for z in range(1, 100+1):
                z2 = z**2
                f = x2 + y2 + z2 + x*y + y*z + z*x
                if f <= N:
                    fc[f] += 1

    for i in range(1, N+1):
        print(fc[i])


def main():
    N = read_int()
    (slv(N))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
from itertools import product
l = list(range(1, 100+1))
f = [0 for _ in range(11000)]
def func(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for x, y, z in product(l, l, l):
    v = func(x,y,z)
    if v <= n:
        f[v] += 1
for ans in f[1:n+1]:
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())
p = [0 for i in range(n)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            N = x**2+y**2+z**2+x*y+y*z+z*x-1
            if N < n:
                p[N] += 1
for i in range(n):
    print(p[i])

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    d = [0 for i in range(n)]
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x**2 + y**2 + z ** 2 + x*y + y*z + z*x <= n:
                    d[x**2 + y**2 + z ** 2 + x*y + y*z + z*x - 1] += 1

    for i in d:
        print(i)

resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()

cnt = [0] * (10**4+1)


for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            tmp = ((i+j)**2 + (j+k)**2 + (k+i)**2) // 2
            if tmp < 10**4 + 1:
                cnt[tmp] += 1

for i in range(1, N+1):
    print(cnt[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=[0]*n
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      a=x**2+y**2+z**2+x*y+y*z+z*x
      if 1<=a<=n:
        ans[a-1]+=1
for a in ans:
  print(a)

Submission status: Accepted

Solution code:
N = int(input())
ans = [0 for _ in range(N)]
for x in range(1, 1000):
    if x**2 > N:
        continue
    for y in range(1, 1000):
        if x**2 + y**2 > N:
            break
        for z in range(1, 1000):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n <= N:
                ans[n-1] += 1
            if n > N:
                break
for a in ans:
    print(a)

Submission status: Accepted

Solution code:
n=int(input())

ans=[0]*(n+1)
for x in range(1,int(n**0.5)+2):
    for y in range(1,int(n**0.5)+2):
        for z in range(1,int(n**0.5)+2):
            if x**2+y**2+z**2+x*y+y*z+z*x<=n:
                ans[x**2+y**2+z**2+x*y+y*z+z*x]+=1

for item in ans[1:]:
    print(item)

Submission status: Accepted

Solution code:
n = int(input())
ans_list = [0 for i in range(10**6 + 1)]
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      a = x**2 + y **2 + z**2 + x*y + z*y + x*z
      ans_list[a] += 1
      
for i in range(1,n+1):
  print(ans_list[i])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()

	ans = [0 for i in range(N)]
	for x in range(1,100+1):
		for y in range(1,100+1):
			for z in range(1,100+1):
				tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x

				if tmp <= N:
					ans[tmp-1] += 1

	for i in ans:
		print(i)




#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
n = int(input())

li = [0]*(10**5)

for i in range(1,10**2+1):
    for j in range(1,10**2+1):
        for k in range(1,10**2+1):
            li[i**2+j**2+k**2+i*j+j*k+k*i] += 1
            
for i in range(1,n+1):
    print(li[i])

Submission status: Accepted

Solution code:
n=int(input())
f=[0]*(10**5)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            cal=x**2+y**2+z**2+x*y+x*z+y*z
            f[cal]+=1
for i in range(1,n+1):
    print(f[i])

Submission status: Accepted

Solution code:
n=int(input())

import math
sq = math.ceil(math.sqrt(n) )

ans = [0]*(n+1)
for x in range(1,sq):
    for y in range(1,sq):
        for z in range(1,sq):
            k = x**2+y**2+z**2+x*y+y*z+z*x
            if k<=n:
                ans[k]+=1
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
N = int(input())

f = [0] * (10 ** 4 + 1)

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if n <= 10000:
                f[n] += 1

for ans in f[1:N + 1]:
    print(ans)

Submission status: Accepted

Solution code:
N=int(input())
D={}

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            A=x*x+y*y+z*z+x*y+y*z+z*x
            if A not in D:
                D[A]=1
            else:
                D[A]+=1
for i in range(1,N+1):
    if i not in D:
        print(0)
    else:
        print(D[i])

Submission status: Accepted

Solution code:
import math
n = int(input())
ans_list = [0 for _ in range(n)]
ceil_n = math.ceil(n ** 0.5)
for x in range(1, ceil_n):
    for y in range(x, ceil_n):
        for z in range(y, ceil_n):
            value = (x ** 2) + (y ** 2) + (z ** 2) + (x*y) + (y*z) + (z * x)
            if value <= n:
                if (x == y) & (y == z):
                    point = 1
                elif (x == y) | (y == z) | (z == x):
                    point = 3
                else:
                    point = 6
                ans_list[value - 1] += point
for i in range(n):
    print(ans_list[i])

Submission status: Accepted

Solution code:
n = int(input())


ans = [0 for i in range(n)]

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            cand = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if cand <= n:
                ans[cand-1] += 1

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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0]*(N+1)
for x in range(1,100):
    xx = x*x
    for y in range(1,100):
        yy = y*y
        xy = x*y
        for z in range(1,100):
            zz = z*z
            zx = z*x
            yz = y*z
            n = xx+yy+zz+xy+yz+zx
            if n<=N: ans[n]+=1

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

Submission status: Accepted

Solution code:
n = int(input())

dic = {}
for x in range(1,100):
    for y in range(1, 100):
        for z in range(1,100):
            a = x**2+y**2+z**2+x*y+y*z+x*z

            if not a in dic:
                dic[a] = 1
            
            else:
                dic[a] += 1

for i in range(1,n+1):
    if not i in dic:
        print(0)
    
    else:
        print(dic[i])