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:
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())

d = defaultdict(int)
sqrtN = int(math.sqrt(N)+1)
for x in range(1, sqrtN+1):
    for y in range(1, sqrtN+1):
        for z in range(1, sqrtN+1):
            ret = x**2 + y**2 + z**2 + x*y + y*z + z*x
            d[ret] += 1
for num in range(1, N+1):
    print(d[num])

Submission status: Accepted

Solution code:
N = int(input())

tbl = [0]*(N+1)
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            a = x*x + y*y + z*z + x*y + y*z + z*x
            if a > N:
                continue
            tbl[a] += 1

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())

    ans = [0 for _ in range(n+1)]
    x = 1
    y = 1
    z = 1
    while True:
        f = x * x + y * y + z * z + x * y + y * z + z * x
        if f > n:
            if z > 1:
                y += 1
                z = 1
            elif y > 1:
                x += 1
                y = 1
            else:
                break
        else:
            ans[f] += 1
            z += 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]*n
for x in range(1,101):
  for y in range(1,101):
    if x*x+y*y>n:
      break
    for z in range(1,101):
      if x*x+y*y+z*z+x*y+x*z+y*z>n:
        break
      ans[x*x+y*y+z*z+x*y+x*z+y*z-1]+=1
for i in range(n):
  print(ans[i])

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    f = [0 for _ in range(200 ** 2 * 6)]
    for x in range(1, 111):
        for y in range(1, 111):
            for z in range(1, 111):
                f[x * x + y * y + z * z + x * y + y * z + z * x] += 1
    for i in range(1, n + 1):
        print(f[i])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#n,k,*a = map(int,read().split())
n, = map(int,read().split())

ans = [0]*(n+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            res = i*i+j*j+k*k+i*j+j*k+k*i
            if res <= n:
                ans[res] += 1

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

Submission status: Accepted

Solution code:
from collections import defaultdict

D = defaultdict(int)

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

N=int(input())
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ret = f(x,y,z)
            if ret>N:
                break
            D[f(x,y,z)]+=1

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

Submission status: Accepted

Solution code:
N = int(input())

f = [0] * (N+1)

for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            v = i*i + j*j + k*k + i*j + j*k + k*i
            if v <= N:
                f[v] += 1

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

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
Ans=[0]*(n+1)
nn=int(n**0.5)+1
for i in range(1,nn+1):
  for j in range(1,nn+1):
    for k in range(1,nn+1):
      cur=i**2+j**2+k**2+i*j+j*k+k*i
      if cur<=n:
        Ans[cur]+=1
for i in range(1,n+1):
  print(Ans[i])

Submission status: Accepted

Solution code:
def examA():
    L, R, D = LI()
    ans = R//D - (L-1)//D
    print(ans)
    return

def examB():
    N = I()
    A = LI()
    ans = 0
    for i,a in enumerate(A):
        if i%2==0:
            if a%2==1:
                ans += 1
    print(ans)
    return

def examC():
    N = I()
    ans = [0]*N
    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 + x*z
                if cur<N+1:
                    ans[cur-1] += 1

    for v in ans:
        print(v)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(2*10**6)

if __name__ == '__main__':
    examC()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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):
            s=i**2+j**2+k**2+i*j+j*k+k*i
            if s<=10000:
                l[s-1]+=1
print(*l[:N],sep="\n")

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())

result = defaultdict(int)

for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			result[x*x + y*y + z*z + x*y + y*z + z*x] += 1
				
for i in range(1, n + 1):
	print(result[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import product

N = int(input())

memo = [0]*N

for x,y,z in product(range(1,100),repeat=3):
    t = x*x+y*y+z*z+x*y+y*z+z*x
    if 0 < t <= N:
        memo[t-1] += 1

print(*memo,sep='\n')

Submission status: Accepted

Solution code:
N = int(input())
X = [0] * (N + 1)
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 * j + j * k + i * k
            if a <= N:
                X[a] += 1
for a in X[1:]:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n = int(input())

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n = int(input())

ans = [0]*10**5

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
print(*ans[1:n + 1], 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):
            val = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if 1 <= val and val <= n:
                ans[val] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
lst = [0 for _ in range(n)]

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            num = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + i * k
            try:
                lst[num - 1] += 1
            except IndexError:
                pass
for num in lst:
    print(num)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache

#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')
AZ = "abcdefghijklmnopqrstuvwxyz"

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n): return kaijo_memo[n]
  if(len(kaijo_memo) == 0): kaijo_memo.append(1)
  while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if n == r: return 1
  if n < r or r < 0: return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1: arr.append([temp, 1])
  if arr==[]: arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b: a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n-1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n: return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

def base_10_to_n_without_0(X, n):
  X -= 1
  if X//n: return base_10_to_n_without_0(X//n, n)+[X%n]
  return [X%n]

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N = I()
dic = DD(int)

for a in range(1,101):
  for b in range(1,101):
    for c in range(1,101):
      dic[a**2+b**2+c**2+a*b+b*c+c*a] += 1
for i in range(N):
  print(dic[i+1])

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    N = 10000
    f = [0]*(N+1)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                s = x**2+y**2+z**2+x*y+y*z+z*x
                if s <= N:
                    f[s] += 1
    for i in range(1,n+1):
        print(f[i])
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
n = int(input())

ans = [0]*n

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

print("\n".join(map(str,ans)))

Submission status: Accepted

Solution code:
n = int(input())
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):
            k = x * x + y * y + z * z + x * y + y * z + z * x
            if k <= 10**4:
                f[k] +=1

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

Submission status: Accepted

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

Submission status: Accepted

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


N=int(input())

ANS=[0]*(10**5+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):
            ANS[x*x+y*y+z*z+x*y+y*z+z*x]+=1

print(*ANS[1:N+1])

Submission status: Accepted

Solution code:
n = int(input())

A = [0] * (n+1)

for i in range(1, 105):
    for j in range(1,105):
        for k in range(1,105):
            l = i**2+j**2+k**2+i*j+j*k+k*i
            if l <= n:
                A[l] += 1
for i in range(1, n+1):
    print(A[i])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    N = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    l=[0]*N
    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                tot=x**2+y**2+z**2+x*y+y*z+z*x
                if tot<=N:
                    l[tot-1]+=1
    for i in range(N):
        print(l[i])






if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    F = [0] * (N + 1)
    for x in range(1, 101):
        X = x ** 2
        for y in range(1, 101):
            Y = y ** 2
            for z in range(1, 101):
                a = X + Y + z ** 2 + x * y + y * z + z * x
                if a <= N: F[a] += 1
    print(*F[1:], sep="\n")
                

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
N = int(input())
res = [0 for _ in range(N)]

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            k = x**2 + y**2 + z**2 + x * y + y * z + z * x
            if k <= N:
                res[k - 1] += 1

print(*res, sep='\n')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import defaultdict
N = int(input())

ans = defaultdict(int)
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
            ans[t] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0 for _ in range(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 i in range(1,n+1):
  print(ans[i])

Submission status: Accepted

Solution code:
f = [0] * (10 ** 4 + 1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            w = x * x + y * y + z * z + x * y + y * z + z * x
            if w < len(f):
                f[w] += 1
n = int(input())
for i in range(1, n + 1):
    print(f[i])

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    ans=[0]*(N+1)
    
    for x in range(1,101):
        for y in range(1,101):
            for z in range(1,101):
                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])

main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.buffer.readline()[:-1]
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
up = int(N**(1/2))+1
ans = [0]*(N+1)
for x in range(1, up):
    for y in range(1, up):
        for z in range(1, up):
            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:
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    m = 100
    l = [0]*10**5
    for i in range(1, m):
        for j in range(1, m):
            for k in range(1, m):
                l[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1
    n = ni()
    prn(l[1:n+1])
    return

solve()

Submission status: Accepted

Solution code:
N=int(input())
X=[0]*10001
for i in range(1,102):
  for j in range(1,102):
    for k in range(1,102):
      if i*i+j*j+k*k+i*j+j*k+k*i<10001:
        X[i*i+j*j+k*k+i*j+j*k+k*i]+=1
for i in range(N):
  print(X[i+1])

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):
            n = x*x + y*y + z*z + x*y + y*z + z*x
            if n <= N:
                ans[n] += 1
print(*ans[1:], sep='\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

C = collections.Counter()
n = int(input())
C0 = 10**2+10
for i in range(1,C0):
  for j in range(1,C0):
    for k in range(1,C0):
      C[i**2+j**2+k**2+i*j+j*k+k*i] += 1
for i in range(1,n+1):
  print(C[i])

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    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):
                val = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if 1 <= val <= N:
                    ans[val] += 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]*n
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>n:break
      ans[x*x+y*y+z*z+x*y+y*z+z*x-1]+=1
print(*ans)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
n = int(input())

a = [0]*10000

for x in range(1, 100):
  for y in range(1, 100):
    for z in range(1,100):
        v = x*x+y*y+z*z+x*y+y*z+x*z
        if  v < 10000:
        	a[v] += 1
for i in range(n):
  print(a[i+1])

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(-1 + (n-2) ** 0.5) + 1
for i in range(1,n+1):
  cnt = 0
  for x in range(1, m):
    for y in range(1, m):
      if (x+y)**2-4*(x**2+y**2+x*y-i) >0:
        z = (-(x+y)+((x+y)**2-4*(x**2+y**2+x*y-i))**0.5)/2       
        if z%1 == 0 and z>0:            
          cnt += 1
      else:
        break
  print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(-1 + (n-2) ** 0.5) + 1
for i in range(1,n+1):
  cnt = 0
  for x in range(1, m):
    for y in range(1, m):
      if (x+y)**2-4*(x**2+y**2+x*y-i) >0:
        z = (-(x+y)+((x+y)**2-4*(x**2+y**2+x*y-i))**0.5)/2       
        if z%1 == 0 and z>0:            
          cnt += 1
      else:
        break
  print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
m = int(-1 + (n-2) ** 0.5) + 1
for i in range(n):
  cnt = 0
  for x in range(1, m):
    for y in range(1, m):
      for z in range(1, m):
        if x * x + y * y + z * z + x * y + y * z + z * x == i:
          cnt += 1
  print(cnt)

Submission status: Runtime Error

Solution code:
# @uthor : Kaleab Asfaw
from sys import stdin, stdout
# Fast IO
def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)
# Others
mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def comb(lst, x):
	from itertools import combination as c
	return list(comb(lst, x))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}
def smaller(lst, x): return bisect_left(lst, x) -1
def smallerEq(lst, x): return bisect_right(lst, x) -1

def solve(n):
	lst = [0] * 1000
	for i in range(1, 101):
		for j in range(1, 101):
			for k in range(1, 101):
				val = (i**2) + (j**2) + (k**2) + (i*j) + (i*k) + (j*k)
				if val >= 1 and val <= 1000:
					lst[val-1] += 1
	for i in range(0, n):
		print(lst[i])

n = int(input())
solve(n)

Submission status: Runtime Error

Solution code:
# @uthor : Kaleab Asfaw
from sys import stdin, stdout
# Fast IO
def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)
# Others
mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def comb(lst, x):
	from itertools import combination as c
	return list(comb(lst, x))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}
def smaller(lst, x): return bisect_left(lst, x) -1
def smallerEq(lst, x): return bisect_right(lst, x) -1

def solve(n):
	lst = [0] * 1000
	for i in range(1, 101):
		for j in range(1, 101):
			for k in range(1, 101):
				val = (i**2) + (j**2) + (k**2) + (i*j) + (i*k) + (j*k)
				if val >= 1 and val <= 1000:
					lst[val-1] += 1
	for i in range(1, n+1):
		print(lst[i])

n = int(input())
solve(n)

Submission status: Runtime Error

Solution code:
# @uthor : Kaleab Asfaw
from sys import stdin, stdout
# Fast IO
def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)
# Others
mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def comb(lst, x):
	from itertools import combination as c
	return list(comb(lst, x))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}
def smaller(lst, x): return bisect_left(lst, x) -1
def smallerEq(lst, x): return bisect_right(lst, x) -1

def solve(n):
	lst = [0] * 1000
	for i in range(1, 101):
		for j in range(1, 101):
			for k in range(1, 101):
				val = (i**2) + (j**2) + (k**2) + (i*j) + (i*k) + (j*k)
				if val >= 1 and val <= 1000:
					lst[val-1] += 1
	for i in range(1, n+1):
		print(lst[i])
	return


n = int(input())
print(solve(n))

Submission status: Runtime Error

Solution code:
n=int(input())
a=[0]*10001
for i in range(101):
  for j in range(101):
    for k in range(101):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<=10001:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Submission status: Runtime Error

Solution code:
n=int(input())
a=[ 0 for _ in range (10000)]
for i in range(100):
  for j in range(100):
    for k in range(100):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<=10000:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Submission status: Runtime Error

Solution code:
n=int(input())
a=[ 0 for _ in range (10000)]
for i in range(100):
  for J in range(100):
    for k in range(100):
      v=i**2+j**2+k**2+i*J+j*k+k*i
      if v<=10000:
        a[v]+=1
for m in range(n):
  print(a[m+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for x in range(1,int(n**.5)+1):
    for y in range(1,int(n**.5)+1):
        for z in range(1,int(n**.5)+1):
            a = x*x+y*y+z*z+x*y+y*z+z*x
            ans[a-1] += 1
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

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

for x in range(1,int(n**.5)+1):
    for y in range(1,int(n**.5)+1):
        for z in range(1,int(n**.5)+1):
            a = x*x+y*y+z*z+x*y+y*z+z*x
            ans[a-1] += 1
for i in range(n):
    print(ans[i])

Submission status: Runtime Error

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):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n <= N:
                ans[n] += 1


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