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:
def main():
    N = int(input())

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = [0 for i in range(N)]

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if tmp > N:
                break
            ans[tmp - 1] += 1

[print(i) for i in ans]

Submission status: Accepted

Solution code:
N = int(input())

f = [0] * (1100000)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            c = x**2 + y**2 + z**2 + x*y + y*z + z*x
            f[c] += 1
for i in range(1, N+1):
    print(f[i])

Submission status: Accepted

Solution code:
N = int(input())
L = [0]*(N+1)
sN = int(N**0.5)+1
for x in range(1,sN+1):
    for y in range(1,sN+1):
        for z in range(1,sN+1):
            P = x**2+y**2+z**2+x*y+y*z+z*x
            if 1<=P<=N:
                L[P]+=1
for i in range(1,N+1):
    print(L[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = [0] * n

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            num = (i + j + k) ** 2 - (i * j + j * k + k * i)
            if num <= n:
                cnt[num - 1] += 1

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

Submission status: Accepted

Solution code:
from itertools import product
N = int(input())
M = int(N**0.5)
ans = [0] * N
for x, y, z in product(range(1, M+1), repeat=3):
    i = x*x + y*y + z*z + x*y + y*z + z*x
    if i <= N:
        ans[i-1] += 1
for i in range(N):
    print(ans[i])

Submission status: Accepted

Solution code:
n=int(input())
ans=[0]*10000

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

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

Submission status: Accepted

Solution code:
def submit():
    n = int(input())
    ans_count = {i: 0 for i in range(1, n + 1)}

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

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                a = f(x, y, z)
                if a <= n:
                    ans_count[a] += 1

    for a in range(1, n + 1):
        print(ans_count[a])


submit()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
from collections import defaultdict
dic = defaultdict(int)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            dic[x**2+y**2+z**2+x*y+y*z+z*x] += 1

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

Submission status: Accepted

Solution code:
N= int(input())
l=[0]*10000
for i in range(1,101):
   for j in range(1,101):
      for k in range(1,101):
         x=i**2+j**2+k**2+i*j+j*k+i*k
         if x>10000:
            pass
         else:
            l[x-1]+=1
for i in range(N):
   print(l[i])

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    ans = [0] * (10000 + 1)

    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x * x + y * y + z * z + x * y + y * z + z * x >= 10001:
                    continue
                ans[x * x + y * y + z * z + x * y + y * z + z * x] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  ans=[0]*(n+1)
  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<=n:
          ans[a]+=1

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

main()
# print(main())

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()

ans = [0]*10002
for x in range(1,101):
	for y in range(1,101):
		for z in range(1,101):
			t = x*x+y*y+z*z+x*y+y*z+z*x
			if t>10000:
				break
			else:
				ans[t]+=1

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

Submission status: Accepted

Solution code:
from math import *
n=int(input())
l=floor(sqrt(n))+1
ans=[0]*n
def f(a,b,c):
    return a*a+b*b+c*c+a*b+b*c+c*a
for x in range(1,l+1):
    for y in range(1,l+1):
        for z in range(1,l+1):
            g=f(x,y,z)
            if g<=n:
                ans[g-1]+=1
for i in range(n):
    print(ans[i])

Submission status: Accepted

Solution code:
import sys
import  math
import fractions
from collections import defaultdict
import copy
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

N=int(input())

ans_l=[0]*(10**5)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            ans_l[i*i+j*j+k*k+i*j+j*k+k*i]+=1


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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0]*(N+1)
f = lambda x, y, z: x**2 + y**2 + z**2 + x*y + y*z + z*x
root_N = int(N**0.5)

for x in range(1, root_N+1):
    for y in range(1, root_N+1):
        for z in range(1, root_N+1):
            i = f(x, y, z)
            if i <= N:
                ans[f(x, y, z)] += 1

print('\n'.join(map(str, ans[1:])))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

N = I()

A = [0]*(100000)

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            A[i**2+j**2+k**2+i*j+j*k+k*i] += 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math


def main():
    N = int(input())
    ans = [0] * N
    for x in range(1, int(math.sqrt(N)) + 1):
        for y in range(1, int(math.sqrt(N)) + 1):
            for z in range(1, int(math.sqrt(N)) + 1):
                n = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if n <= N:
                    ans[n - 1] += 1
    for a in ans:
        print(a)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())

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

for x in range(1,10**2+1):
    for y in range(1,10**2+1):
        for z in range(1,10**2+1):
            now=x**2+y**2+z**2+x*y+y*z+z*x
            ans[now-1]+=1

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


    if i==N-1:
        break

Submission status: Accepted

Solution code:
n = int(input())
arr = [0] * (n+1)
for i in range(1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      if i*i+j*j+k*k + i*j+j*k+k*i <= n:
        arr[i*i+j*j+k*k + i*j+j*k+k*i] += 1
for i in range(1, n+1):
  print(arr[i])

Submission status: Accepted

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

MAX = 10**2

def solve(N: int):
    ans = [0]*N
    for xi in range(1, MAX):
        x2 = xi**2
        for yi in range(1, MAX):
            y2 = yi**2
            for zi in range(1, MAX):
                k = x2 + y2 + zi**2 + xi*yi + xi * zi + yi*zi
                if k > N: break
                else: ans[k-1] +=1

    for ai in ans:
        print(ai) 
                

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    l=[0]*(n+1)

    for x in range(1,10**2+1):
        for y in range(1,10**2+1):
            for z in range(1,10**2+1):
                val=x**2+y**2+z**2+x*y+y*z+z*x
                if val<=n:
                    l[x**2+y**2+z**2+x*y+y*z+z*x]+=1
                else: continue
    
    for i in range(1,n+1):
        print(l[i])
    
resolve()

Submission status: Accepted

Solution code:
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*x+y*y+z*z+x*y+y*z+z*x
            if 1 <= tmp <= N:
                ans[tmp] += 1
for i in range(1,N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())

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

for i in range(1,200):
    for j in range(1,200):
        for k in range(1,200):
            a = i**2 + j**2 + k**2 + (i*j) + (j*k) + (k*i)
            if a <= 10**4:
                ans[a] += 1
                
for i in range(1,n+1):
    print(ans[i])

Submission status: Accepted

Solution code:
N = int(input())
ans = {i: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):
            n = i*i + j*j + k*k + i*j + j*k + k*i
            if n in ans: ans[n] += 1
for i in range(1, N+1):
    print(ans[i])

Submission status: Accepted

Solution code:
import math

N = int(input())

M = math.ceil(math.sqrt(N)) + 1

f_list = [0] * (N + 1)

for x in range(1, M):
	for y in range(1, M):
		for z in range(1, M):
			f = x * x + y * y + z * z + x * y + y * z + z * x
			if f >= 1 and f <= N:
				f_list[f] += 1

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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0 for i in range(10 ** 4 + 1)]
for i in range(1,100):
    for i2 in range(1,100):
        for i3 in range(1,100):
            k = i**2 + i2 ** 2 + i3 ** 2 + i * i2 + i2 * i3 + i3 * i
            if k <= 10 ** 4:
                ans[k] += 1
for i in range(N):
    print(ans[i+1])

Submission status: Accepted

Solution code:
from collections import defaultdict
              
N = int(input())
              
v2c = defaultdict(int)
for x in range(1, 101):
    for y in range(x, 101):
        for z in range(y, 101):
            v = x*x+y*y+z*z+x*y+y*z+z*x
            if x==y and y==z:
                v2c[v] += 1
            elif (x==y or y==z):
                v2c[v] += 3
            else:
                v2c[v] += 6
              
for i in range(1, N+1):
    print(v2c[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*(n+1)
for x in range(1, int(n**0.5+10)):
    for y in range(1, int(n**0.5+10)):
        for z in range(1, int(n**0.5+10)):
            if x*x+y*y+z*z+x*y+y*z+z*x <= n:
                ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1
for i in range(n):
    print(ans[i+1])

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


N = int(input())

ans = [0] * 10001

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            ret = x * x + y * y + z * z + x * y + y * z + z * x
            if ret < 10001:
                ans[ret] += 1

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

Submission status: Accepted

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

for x in range(1, 10**2+1):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            num = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if num <= n:
                ans[num] += 1
            else:
                break

for res in ans[1:n+1]:
    print(res)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = [0] * n

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

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

main()

Submission status: Accepted

Solution code:
n = int(input())

f = [0] * 10**5
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            f[i**2+j**2+k**2+i*j+j*k+k*i] += 1

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    nmax = 10**2
    ans = [0] * (10**4+1)
    for i in range(1, nmax):
        for j in range(1, nmax):
            for k in range(1, nmax):
                c = i*i + j*j + k*k + i*j + j*k + k*i
                if c > 10**4:
                    continue
                ans[c] += 1
    for i in range(1, N+1):
        print(ans[i])



main()

Submission status: Accepted

Solution code:
def f(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
 
N = int(input())
ans = [0]*N

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            M = f(x,y,z)
            if M <= N:
                ans[M-1] += 1
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
#[int(i) for i in input().split()]
import collections
n = int(input())

dic = collections.defaultdict(int)
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            dic[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i] += 1

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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0]*(N+1)
for x in range(1,100):
    for y in range(x,100):
        for z in range(y,100):
            tmp = x**2+y**2+z**2+x*y+y*z+z*x
            if 1<=tmp<=N:
                if x==y and y==z:
                    k = 1
                elif x==y or y==z or z==x:
                    k = 3
                else:
                    k = 6
                ans[tmp] += k
for x in ans[1:]:
    print(x)

Submission status: Accepted

Solution code:
n=int(input())

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

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

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

Submission status: Accepted

Solution code:
#create date: 2020-07-11 21:03

import sys
stdin = sys.stdin
from itertools import product

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    l = [0] * (10 **4 + 1)
    for x, y, z in product(range(1, 101), repeat=3):
        m =  x**2 + y**2 + z**2 + x*y + y*z + z*x
        if m <= 10**4:
            l[m] += 1
    for i in range(n):
        print(l[i+1])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())

ct = Counter()

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            t = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ct[t] += 1

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

Submission status: Accepted

Solution code:
n=int(input())
squre=int(n**0.5)

A=[0 for _ in range(10**6)]
for x in range(1,squre+1):
    for y in range(1,squre+1):
        for z in range(1,squre+1):
            num=x**2+y**2+z**2+x*y+y*z+z*x
            A[num] +=1

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

Submission status: Accepted

Solution code:
from itertools import product
from collections import defaultdict

N = int(input())
M = int(N**(0.5) + 1)

dict = defaultdict(int)

for x, y, z in product(range(1,M+1),repeat=3):
    dict[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1

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

Submission status: Accepted

Solution code:
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):
            f = x ** 2 + y ** 2 + z ** 2 + x*y + y*z + z*x
            if f > N:
                break
            else:
                ans[f] += 1

print(*ans[1:], sep = '\n')

Submission status: Accepted

Solution code:
## coding: UTF-8
N = int(input())

ans = [0] * (10**4+10)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            #print(x, y, z)
            p = x*x + y*y + z*z + x*y + y*z + z*x
            if(p < 10**4+10):
                ans[p] += 1

#print(ans[:30])
for i in range(N):
    print(ans[i+1])

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

N = int(input())

ans = [0] * (N + 1)

def f(n):
    l = round(math.sqrt(n)) + 1
    for x in range(1, l):
        for y in range(1, l):
            for z in range(1, l):
                val = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if val <= N:
                    ans[val] += 1
f(N)

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
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 LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

n=II()
cnt=[0]*(n+1)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            cur=x**2+y**2+z**2+x*y+y*z+z*x
            if cur>n:break
            cnt[cur]+=1
for c in cnt[1:]:print(c)

Submission status: Accepted

Solution code:
N = int(input())
L = [0 for _ in range(10010)]
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      X = x * x + y * y + z * z + x * y + y * z + z * x
      if X <= N:
        L[X] += 1
for i in range(1, N+1):
  print(L[i])

Submission status: Accepted

Solution code:
n = int(input())

ans = [0] * n

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

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N = II()

    cnt = {}
    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 + z*x
                cnt[a] = cnt.get(a, 0) + 1
    # print(cnt)
    # print(cnt.get(6))

    for i in range(1, N+1):
        print(cnt.get(i, 0))

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())
MAX = 10 ** 2 + 10
ans = [0] * (N+1)
for x in range(1,MAX):
    for y in range(1,MAX):
        for z in range(1,MAX):
            tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if tmp <= N:
                ans[tmp] += 1

print(*ans[1:], sep="\n")

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
C = defaultdict(int)
for x in range(1, 10**2+1):
    for y in range(1, 10**2+1):
        for z in range(1, 10**2+1):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            C[n] += 1

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

Submission status: Accepted

Solution code:
N = int(input())
ans = [0] * N
for x in range(1, 102):
    for y in range(1, 102):
        for z in range(1, 102):
            t = x*x+y*y+z*z+x*y+y*z+z*x
            if 1 <= t <= N:
                ans[t-1] += 1
print(*ans, sep='\n')

Submission status: Accepted

Solution code:
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):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if a <= n:
                ans[a] += 1
for x in ans[1:]:
    print(x)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    N = ii()
    l = [0]*(N+1)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                t = x*x+y*y+z*z+x*y+y*z+z*x
                if t <= N:
                    l[t] += 1
    print(*l[1:], sep='\n')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            su = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if(su <= n):
                ans[su-1] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
MX = 10**4
ans = [0]*(10**4+5)

for x in range(1,MX):
    now = x*x
    for y in range(1,MX):
        now2 = now + y*y
        if(now2>MX):
            break
        for z in range(1,MX):
            now3 = now2 + z*z + x*y + y*z + z*x
            if(now3>MX):
                break
            ans[now3]+=1

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

Submission status: Accepted

Solution code:
n = int(input())
f = [0] * (n + 1)
t = int(n ** .5) + 3
for i in range(1, t):
    for j in range(1, t):
        for k in range(1, t):
            res = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if res <= n:
                f[res] += 1
print('\n'.join(map(str, f[1:])))

Submission status: Accepted

Solution code:
n = int(input())
ans = []
f = [0 for _ in range(10**4+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:
                f[tmp] += 1
for i in range(1, n+1):
    ans.append(str(f[i]))
print("\n".join(ans))

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
res = [0] * n
def cal(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
for fl in itertools.product(range(1,100),range(1,100),range(1,100)):
    x,y,z = fl
    tmp = cal(x,y,z)
    if n >= tmp:
        res[tmp-1] += 1
print(*res)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ans = [0] * (N + 100)
    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:
                    continue
                ans[tmp] += 1

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



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
ls = [0] * 1001001
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			ls[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, N+1):
	print(ls[i])
	

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Accepted

Solution code:
from collections import Counter
from itertools import product

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

cnt = Counter()
N = int(input())
for x, y, z in product(range(1, 101), repeat=3):
    cnt[f(x, y, z)] += 1
for i in range(1, N+1):
    print(cnt[i])

Submission status: Accepted

Solution code:
n = int(input())

ans = [0] * (n+1)

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      a = i**2+j**2+k**2+i*k+k*j+j*i
      d[a] += 1
      
n = int(input())
for i in range(1,n+1):
  print(d[i])

Submission status: Accepted

Solution code:
n = int(input())
lis=[0]*n
for a in range(1,101):
    for b in range(1,101):
        for c in range(1,101):
            x=a**2+b**2+c**2+a*b+b*c+c*a
            if x<=n:
                lis[x-1]+=1
for li in lis:
    print(li)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
cnt = [0] * 11000

n = int(input())

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            value = x*x + y*y + z*z + x*y + y*z + z*x
            if value <= n:
                cnt[value] += 1

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

Submission status: Accepted

Solution code:
from typing import Collection

from collections import defaultdict
n = int(input())

f = defaultdict(int)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            d = x * x + y * y + z * z + x * y + y * z + z * x
            if 1 <= d <= 10 ** 4:
                f[d] += 1
for i in range(1, n + 1):
    print(f[i])

Submission status: Accepted

Solution code:
import heapq
from collections import defaultdict, deque
from math import ceil, factorial, gcd
from itertools import accumulate, permutations

import bisect
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

N = int(input())
C = defaultdict(int)
for x in range(1, 10**2+1):
    for y in range(1, 10**2+1):
        for z in range(1, 10**2+1):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            C[n] += 1

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