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:
#!/usr/bin/env python3
import sys
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from itertools import accumulate

sys.setrecursionlimit(10**6)
INF = 10**12
m = 10**9 + 7

def main():
    N = int(input())
    ans = [0]*10**4
    for x in range(1,10**2+1):
        for y in range(1,10**2+1):
            for z in range(1,10**2+1):
                tmp = (x+y+z)**2-x*y-y*z-z*x
                if tmp <= 10**4:
                    ans[tmp-1] += 1
    for i in range(N):
        print(ans[i])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    tb=[0]*(10**4+2)
    n=int(readline())
    for x in range(1,10**2+1):
        for y in range(1,10**2+1):
            for z in range(1,10**2+1):
                f=x*x+y*y+z*z+x*y+y*z+z*x
                if f <= 10**4:
                    tb[f]+=1
    for i in range(1,n+1):
        print(tb[i])
    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

Solution code:
import itertools

N = int(input())

ans = [0] * (10 ** 4)
for x, y, z in itertools.product(range(1, 100), repeat=3):
    a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    if a <= N:
        ans[a - 1] += 1
print(*ans[:N], sep='\n')

Submission status: Accepted

Solution code:
N=int(input())
f=lambda x,y,z:x*x+y*y+z*z+x*y+y*z+z*x

T=[0]*(N+1)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            t=f(x,y,z)
            if t<=N:
                T[t]+=1

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

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
dic=defaultdict(int)

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

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

Submission status: Accepted

Solution code:
N = int(input())

count = [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:
                count[tmp] += 1

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0] * (n + 1)
m = 100
for i in range(1, m + 1):
  for j in range(1, m + 1):
    for k in range(1, m + 1):
      s = i**2 + j**2 + k**2 + i*j + j*k + k*i
      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
from collections import Counter

counter = Counter()

N = int(input())

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

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*10000
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            x = i*i+j*j+k*k+i*j+j*k+k*i
            if (x<=10**4):
                ans[x-1] += 1
ans = ans[:n]
print(*ans ,sep="\n")

Submission status: Accepted

Solution code:
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):
			n = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x
			if n > 10 ** 4:
				continue
			ans[n] += 1

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

Submission status: Accepted

Solution code:
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

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

#処理内容
def main():
	N = int(input())
	D = defaultdict(int)
	for i in range(1, 101):
		for j in range(1, 101):
			for k in range(1, 101):
				val = cal(i, j, k)
				D[val] += 1

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


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
N=int(input())
L=[0]*(10**4)
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      if i**2+j**2+k**2+i*j+j*k+k*i<=10**4:
        L[(i**2+j**2+k**2+i*j+j*k+k*i)-1]+=1
for i in range(N):
  print(L[i])

Submission status: Accepted

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

from collections import defaultdict

N = int(input())

res = defaultdict(int)

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

for x in range(1, 10**2+1):
    y = 1
    while g(x, y, 1) <= N:
        z = 1
        while g(x, y, z) <= N:
            res[g(x, y, z)] += 1
            z += 1
        y += 1

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    F = [0] * (N + 1)
    for x in range(1, N):
        if x * x > N - 5:
            continue
        for y in range(1, N):
            Y = x * x + y * y + x * y
            if Y > N - 3:
                continue
            for z in range(1, N):
                Z = Y + z * z + y * z + z * x
                if Z > N:
                    continue
                F[Z] += 1

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

main()

Submission status: Accepted

Solution code:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            d[i*i+j*j+k*k+i*j+j*k+k*i] += 1
for i in range(1,N+1):
    print(d[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+1):
        for z in range(1, 10**2+1):
            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 i in range(1, len(ans)):
    print(ans[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):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n>N:
                continue
            ans[n-1]+=1
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
C = [0]*(10**5)
U = 10**2
for x in range(1, U+1):
    for y in range(1, U+1):
        for z in range(1, U+1):
            temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if temp < 10**5:
                C[temp] += 1
n = int(input())
for i in range(1, n+1):
    print(C[i])

Submission status: Accepted

Solution code:
n = int(input())
X = [0]*(10**4+1)

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            t = (x+y)**2+(y+z)**2+(z+x)**2
            if t%2 == 0:
                if 0 <= t//2 <= 10**4:
                    X[t//2] += 1

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
from itertools import product
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return [LIST() for _ in range(n)]
def NSTR(n): return [input() for _ in range(n)]


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


def main():
    N = INT()
    ans = [0]*(N+1)
    for x, y, z in product(range(1, int(N**0.5)+1), repeat=3):
        buf = x**2+y**2+z**2+x*y+y*z+z*x
        if buf <= N:
            ans[x**2+y**2+z**2+x*y+y*z+z*x] += 1
    print(*ans[1:], sep="\n")

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
M = 10 ** 2

L = [0] * (N + 1)
for i in range(1, M + 1):
  for j in range(1, M + 1):
    for k in range(1, M + 1):
      t = (i + j + k) ** 2 - i * j - j * k - k * i
      if t <= N:
        L[t] +=1

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

Submission status: Accepted

Solution code:
N = int(input())

ans = [0] * (10 ** 4 + 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):
            tmp = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if tmp <= N:
                ans[tmp] += 1

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

Submission status: Accepted

Solution code:
N=int(input())
r=[0]*N
from itertools import product
for x,y,z in product(range(1,100),repeat=3):
    p=x*x+y*y+z*z+x*y+y*z+z*x
    if 0<p<=N:
        r[p-1]+=1
print(*r,sep='\n')

Submission status: Accepted

Solution code:
N = int(input())
L = [0] * (10 ** 4 + 1)

for a in range(1, 10 ** 2):
    for b in range(1, 10 ** 2):
        for c in range(1, 10 ** 2):
            num = a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a
            if num <= 10 ** 4:
                L[a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a] += 1

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

Submission status: Accepted

Solution code:
n = int(input())

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

for i in range(1,n+1):
    print(ans[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):
                t = x**2 + y**2 + z**2 +x*y + y*z + z*x
                if t <= N:
                    ANS[t] += 1
    print("\n".join( map(str, ANS[1:])))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    A = [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 + x*z
                if tmp <= n:
                    A[tmp] += 1
    for i in range(1,n + 1):
        print(A[i])

    return
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    N=int(input())
    cnt=[0]*(8*N)
    r=int(N**0.5)+1
    for x in range(1,r):
        for y in range(1,r):
            for z in range(1,r):
                cnt[x*x+y*y+z*z+x*y+y*z+z*x]+=1
                
    for i in range(1,N+1):
        print(cnt[i])
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def isqrt(n):
    if n > 0:
        x = 1 << (n.bit_length() + 1) // 2
        y = (x + n // x) // 2
        while y < x:
            x = y
            y = (x + n // x) // 2
        return x
    elif n == 0:
        return 0
    else:
        raise ValueError("isqrt() argument must be nonnegative")


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

    ans = [0] * (N + 1)
    sqrt_n = isqrt(N)
    for x in range(1, sqrt_n + 1):
        for y in range(1, sqrt_n + 1):
            for z in range(1, sqrt_n + 1):
                s = x * x + y * y + z * z + x * y + y * z + z * x
                if s <= N:
                    ans[s] += 1

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import itertools, collections
N = int(input())
ans = collections.defaultdict(int)
for x, y, z in itertools.product(range(1, 101), repeat=3):
    n = x**2 + y**2 + z**2 + x * y + y * z + z * x
    ans[n] += 1
print('\n'.join(str(ans[i]) for i in range(1, N + 1)))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

def l_in():
    return list(map(int, input().split()))

n = n_in()

from itertools import product
from collections import Counter
c = Counter()

for x,y, z in list(product(range(1, 101), repeat=3)):
       c[x*x+y*y+z*z+x*y+y*z+z*x] += 1

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
#pyrival orz
import os
import sys
from io import BytesIO, IOBase

"""
    for _ in range(int(input())):
    n,m=map(int,input().split())
    n=int(input())
    a = [int(x) for x in input().split()]
"""

def main():
    n=int(input())
    a=[0]*(n+1)
    for i in range(1,101):
        for j in range(1,101):
            for k in range(1,101):
                v=i*i+j*j+k*k+i*j+j*k+i*k
                if v>n:
                    break
                a[v]+=1
    for x in a[1:]:
        print(x)

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def resolve():
    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 a <= n:
                    ans[a - 1] += 1
    for i in ans:
        print(i)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n = readint()

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

printrows(ans[1:])

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
N = int(input())

cnt = [0] * N

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            tmp = x * x + y * y + z * z + x * y + y * z + z * x
            if tmp <= N:
                cnt[tmp-1] += 1

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

Submission status: Accepted

Solution code:
N = int(input())

f = [0] * (N + 1)

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:
        f[n] += 1

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

Submission status: Accepted

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

for x in range(1,101):
	for y in range(1,101):
		for z in range(1,101):
			c = x**2+y**2+z**2+x*y+y*z+z*x
			if c<=n: f[c]+=1
for i in range(1,n+1):
	print(f[i])

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    N = in_n()

    mn = int(N**0.5) + 5
    d = defaultdict(int)

    for x in range(1, mn):
        for y in range(1, mn):
            for z in range(1, mn):
                d[x**2 + y**2 + z**2 + x * y + y * z + z * x] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    N = NI()
    A = [0] * (N+1)
    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 t <= N:
                    A[t] += 1
    for i in range(1, N+1):
        print(A[i])


if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

Solution code:
N = int(input())

ret = [0] * (N + 1)

for x in range(1, N + 1) :
  if x * x > N : break
  for y in range(x, N + 1) :
    if x * x + y * y + x * y > N : break
    for z in range(y, N + 1) :
      if x * x + y * y + z * z + x * y + y * z + z * x > N : break
      n = x * x + y * y + z * z + x * y + y * z + z * x
      k = len(set([x, y, z]))
      if k == 1 :
        ret[n] += 1
      elif k == 2 :
        ret[n] += 3
      elif k == 3 :
        ret[n] += 6
        
for i in range(1, N + 1) :
  print(ret[i])

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*n
for x in range(1,10**2):
    for y in range(1,10**2):
        for z in range(1,10**2):
            f = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if f <= n:
                ans[f-1] += 1
print("\n".join(str(i) for i in ans))

Submission status: Accepted

Solution code:
N = int(input())
#S = str(input())
#L, R, d = map(int, input().split())
#A = list(map(int, input().split()))
ans = [0] * (N + 1)

for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      now = i ** 2 + i * (j + k) + j ** 2 + k ** 2 + j * k
      if now <= N:
        ans[now] += 1
  
for i in range(1, N + 1):
  print(ans[i])

Submission status: Accepted

Solution code:
(N, ) = [int(n) for n in input().split()]

F = [0 for _ in range(N)]

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            val = x * x + y * y + z * z + x * y + y * z + z * x
            if val <= N:
                F[val-1] += 1
for f in F:
    print(f)

Submission status: Accepted

Solution code:
n = int(input())

count = [0]*(n+1)

for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            ans = (x+y)**2+(y+z)**2+(z+x)**2
            if ans%2 == 0 and ans//2 <= n:
                count[ans//2] += 1
for i in count[1:]:
    print(i)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N = int(readline())
L = [0]*(N+1)
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            c = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if c <= N:
                L[c] += 1
for i in range(1,N+1):
    print(L[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):
            v = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if 1 <= v <= n:
                ans[v] += 1

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

Submission status: Accepted

Solution code:
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
n=I()
lis=[0 for i in range(100000)]
for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            u=x**2+y**2+z**2+x*y+y*z+z*x
            lis[u-1]+=1
for i in range(n):
    print(lis[i])

Submission status: Accepted

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

for i in range(1, 110):
    for j in range(1, 110):
        for k in range(1, 110):
            tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if tmp <= n:
                ans[tmp] += 1
for i in range(1, n + 1):
    print(ans[i])

Submission status: Accepted

Solution code:
n = int(input())
li = [0]*(10001)
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 tmp>10000:
                continue
            li[tmp] += 1
for i in range(1, n+1):
    print(li[i])

Submission status: Accepted

Solution code:
n = int(input())

ansl = [0]*(n+1)

for x in range(1,10**2):
    for y in range(1, 10**2):
        for z in range(1,10**2):
            val = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if val <= n:
                ansl[val] += 1

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

Submission status: Accepted

Solution code:
N=int(input())
M=int(pow(N, 1/2))
ans=[0]*(N+1)
for x in range(1, M+1):
  for y in range(1, M+1):
    for z in range(1, M+1):
      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:
n=int(input())
l=[0]*(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+x*z+y*z
            if k<=n:
                l[k-1]+=1
print(*l,sep="\n")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
stdin = sys.stdin


def ni(): return int(ns())


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


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()

ans_array = [0] * (N+1)

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 d <= N:
                ans_array[d] += 1


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

Submission status: Accepted

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

    ans = [0]*N
    for i in range(1, 101):
        for j in range(1, 101):
            for k in range(1, 101):
                res = i**2 + j ** 2 + k**2 + i*j + j*k + k*i
                if res > N:
                    continue
                else:
                    ans[res-1] += 1

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


main()

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

n = int(stdin.readline().rstrip())
li = [0]*1000000

for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            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:
import sys
input = sys.stdin.readline

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

print(*ans, sep="\n")

Submission status: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in R(V)]
    FromStdin=True if ls==None else False
    for i in R(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()

show_flg=False
show_flg=True

ans=0

n=I()
a=[0]*(n+1)

#for i in range(l,r+1):
for x in rep(1,101):
    for y in rep(1,101):
        for z in rep(1,101):
            t=x**2+y**2+z**2+x*y+y*z+z*x
            if t<=n:
                a[t]+=1

for i in rep(n):
    print(a[i+1])

Submission status: Accepted

Solution code:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
l=[0]*(10**4+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):
            if x**2+y**2+z**2+x*y+y*z+z*x<=10**4:
                l[x**2+y**2+z**2+x*y+y*z+z*x]+=1
for i in range(1,n+1):
    print(l[i])

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 for i in range(n+1)]

for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            now = f(i,j,k)
            if 1 <= now <= n:
                ans[now] += 1
for i in range(1,n+1):
    print(ans[i])