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: Wrong Answer

Solution code:
from itertools import combinations_with_replacement

n = int(input())

for i in range(1, n+1):
    ans = 0
    for v in combinations_with_replacement(range(1, 22), 3):        
        x, y, z = v

        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
            if x == y == z:
                ans = 1
            else:
                ans = 3
            break

    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

anslist = [0] * 10**4
for i in range(1, int((10000/3)**0.5)+1):
    x = i
    for j in range(i, int(((10000-i**2)/2)**0.5)+1):
        y = j
        for k in range(j, int(((10000-i**2-j**2)/2)**0.5)+1):
            z = k
            uhen = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if uhen-1 >= 10**4:
                continue
            if x == y == z:
                anslist[uhen-1] = 1
            elif x != y and x != z and y != z:
                anslist[uhen-1] = 6
            else:
                anslist[uhen-1] = 3


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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans1 = [0] * N
ans2 = [0] * N
ans3 = [0] * N

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,22):
            if (x**2+y**2+z**2+x*y+y*z+z*x) <= N:
                n = int(0.5*((x+y)**2+(y+z)**2+(z+x)**2))
                if x == y and y == z and z == x:
                    ans1[n-1] = 1
                elif x == y or y == z or z == x:
                    ans2[n-1] = 3
                elif x != y and y != z and z != x:
                    ans3[n-1] = 6
for x,y,z in zip(ans1, ans2, ans3):
    print(x+y+z)

Submission status: Wrong Answer

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

def cob(m):
    if m <= 0:
        return m
    return m + cob(m-1)

# x > y > z
test = False
for x in range(1,N+1):
    if test == True:
        break
    for y in range(1,x+1):
        if test == True:
            break
        for z in range(1,y+1):
            ans = x**2 + y**2 + z**2 + x*y + y*z + z*x
            cnt = cob(len(set([x,y,z])))
            if ans > N:
                test = True
                break
            n[ans-1] += cnt

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

Submission status: Wrong Answer

Solution code:
import itertools

record = [0] * (10 ** 4 + 1)
for p in itertools.product(range(1, 41), range(1, 41), range(1, 41)):
    x, y, z = p
    n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    record[n] += 1

N = int(input())
for i in range(1, N + 1):
    print(record[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
for p in range(1,N+1) :
    cnt = 0
    for i in range(1,int(N*0.5)+1) :
        for j in range(1,int(N*0.5)+1) :
            for k in range(1,int(N*0.5)+1) :
                if (i + j + k)**2 - i*j*k == p  :
                    cnt += 1
    print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools
import math
a = int(input())

def calc(x,y,z,n):
  if(n==x*x+y*y+z*z+x*y+y*z+z*x):
    return True

for i in range(1,a+1):
  l = list(range(int(math.sqrt(a+1))))
  cnt = 0;
  for x,y,z in itertools.combinations_with_replacement(l, 3):
    if(calc(x,y,z,i)):
      cnt+=1;
  print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
mul=1
while ans<=N:
    ans=6*(mul**2)
    mul+=1
ANS={}
for i in range(1,40):
    for j in range(i,60):
        for k in range(j,101):
            if i!=j and j!=k and k!=i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=6
            elif i==j and j==k and k==i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=1
            else:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=3
for Z in range(1,N+1):
    if Z in ANS.keys():
        print(ANS[Z])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
from itertools import combinations
N=int(input())
ans=[0]*(10**6)
for x in range(1,N+1):
    if x**2>N:
        break
    for y in range(x,N+1):
        if x**2+y**2>N:
            break
        for z in range(y,N+1):
            if x**2+y**2+z**2>N:
                break
            else:
                kari=[x,y,z]
                #print(kari)
                if x**2+y**2+z**2+x*y+y*z+z*x<=10**5:
                    if len(set(kari))==1:
                        ans[x**2+y**2+z**2+x*y+y*z+z*x-1]=1
                    else:
                        ans[x**2+y**2+z**2+x*y+y*z+z*x-1]=len(list(combinations(kari,2)))
for i in range(N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())

def f(n):
    flag = False
    #total = 0
    ans = 0
    i = 125
    for x in range(1,i):
        for y in range(1,i-x):
            for z in range(1,i-(x+y)):
                if (x + y + z)**2 - (x*y + y*z + x*z) == n:
                    #total += 1
                    flag = True
                    break
            if flag:
                break
        if flag:
            break
    if x == i-1:
        ans = 0
    elif x == y and  y== z:
        ans = 1
    elif x == y or y == z or x == z:
        ans = 3
    else:
        ans = 6
    return ans

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

Submission status: Wrong Answer

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy


def main():
    n = int(input())
    ans = [0]*(10**4)
    h = 0

    for i in range(1,51):
        for j in range(1,51):
            for m in range(1,51):
                h = i*(i+j) + j*(j+m) + m*(m+i)
                if h >= len(ans):
                    break
                ans[h-1] += 1



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

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]*10**4
ans = 0
for i in range(1, 101):
  for j in range(1, min(i+1,101)):
    for k in range(1, min(j+1, 101)):
       if (i+j+k)**2-i*j-j*k-k*i <= 10**4:
          p = (i+j+k)**2-i*j-j*k-k*i
          if i==j==k:
             a[p-1] +=1
          else:
             a[p-1] +=3
for q in a[:n]:
  print(q)

Submission status: Wrong Answer

Solution code:
from itertools import product

n = int(input())

for num in range(1, n+1):
    count = 0
    prod = product([1,2,3], repeat=3)
    for i in prod:
        x = i[0]
        y = i[1]
        z = i[2]

        if x**2 + y**2 + z**2 +x*y + y*z + z*x == num:
            count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
d = {i+1: 0 for i in range(N)}
for i in range(1, int(N**0.5)):
    for j in range(1, i+1):
        for k in range(1, j+1):
            n = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if n > N:
                continue
            if len(set([i, j, k])) == 1:
                d[n] +=  1
            else:
                d[n] +=  3
for i in range(N):
    print(d[i+1])

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=[0]*n
x=1
y=1
z=1
c=0
for i in range(1,n+1):
	if 6*i*i>n:
		d=i
		break;
print(d)

for i in range(1,n+1):
	if 1+2*i*i+i+i+i*i>n:
		e=i
		break;
print(e)

for i in range(d):
	x=i+1
	y=x
	z=x
	for j in range(i,e):
		y=j+1
		z=y
		for k in range(j,n):
			z=k+1
			print(x,y,z)
			b=x*x+y*y+z*z+x*y+y*z+z*x
			if b>n:
				c=1
				break;
			if x!=y and y!=z and z!=x:
				ans[b-1]+=6
			elif (x==y and x!=z) or (y==z and x!=y):
				ans[b-1]+=3
			elif x==y and y==z:
				ans[b-1]+=1
		#if c==1:
			#break;
	#if c==1:
		#break;


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

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [0] * 25000
for x in range(1, 50):
    for y in range(1, 50):
        for z in range(1, 50):
            n_ = x**2 + y**2 + z**2 + x*y + y*z + z*x
            arr[n_-1] += 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [0 for _ in range(N)]
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if m <= N:
                if x == y == z:
                    l[m - 1] += 1
                elif x == y or y == z or z == x:
                    l[m - 1] = 3
                else:
                    l[m - 1] = 6
            else:
                break

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

Submission status: Wrong Answer

Solution code:
N = int(input())
def func(n):
  ret = 0
  for i in range(1,int(n**0.5)+1):
    for j in range(1,int(n**0.5)+1):
      for k in range(1,int(n**0.5)+1):
        if (i+j)**2+(j+k)**2+(k+i)**2 == 2*n:
          ret += 1
  return ret
for i in range(1,N):
  print(func(i))

Submission status: Wrong Answer

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy


def main():
    n = int(input())
    ans = [0]*(10**4+1)
    h = 0
    
    for i in range(1,51):
        for j in range(1,51):
            for m in range(1,51):
                h = i*(i+j) + j*(j+m) + m*(m+i)
                if h > len(ans):
                    break
                ans[h-1] += 1



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

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
n=int(input())
ls=[0]*n
x=1
y=1
z=1
p=6
m=int(n**0.5)
for x in range(1,m+3):
  for y in range(1,x+1):
    for z in range(1,y+1):
      k=6
      if x==y:
        k=3
        if x==z:
          k=1
      j=x*x+y*y+z*z+x*y+y*z+x*z
      if j<=n:
        ls[j-1]+=k
      else:
        break
for i in ls:
  print(i)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
def g(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
ans = []
def f(n):
    sum = 0
    rn = int(math.sqrt(n))
    
    for i in range(1,rn):
        #print(i,end='')
        for j in range(1,rn):
            for k in range(1,rn):
                #print(i,j,k)
                if g(i,j,k) == n:
                    if (i == j and j==k):
                        sum += 1
                        ans.append(str(sum))
                        return
                    elif (i == j and j != k) or (i == k and j != k) or (i != j and j == k):
                        sum += 3
                        ans.append(str(sum))
                        return
                    elif i != j and i != k and j != k:
                        sum += 6
                        ans.append(str(sum))
                        return
                elif g(i,j,k) > n:
                    break
    ans.append(str(0))
                

    

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

print('\n'.join(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [0 for _ in range(N)]
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if m <= N:
                if x == y == z:
                    l[m - 1] = 1
                elif x == y or y == z or z == x:
                    l[m - 1] = 3
                else:
                    l[m - 1] += 6
            else:
                break

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

Submission status: Wrong Answer

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


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


N = int(input())
NL = []
for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            NL.append(f(x, y, z))
for i in range(1, N):
    print(NL.count(i))

Submission status: Wrong Answer

Solution code:
N=int(input())
keys=[]
for i in range(10**4):
  keys.append(str(i+1))
values=[0]*(10**4)
d=dict(zip(keys, values))
for x in range(1, 150):
  for y in range(x,150):
    tmp=(x+y)**2
    for z in range(y, 150):
      if (tmp+(y+z)**2+(x+z)**2)%2==1:
        continue
      s=(tmp+(y+z)**2+(x+z)**2)//2
      key=str(s)
      if x==y and y==z:
        v=1
      elif (x==y and y<z) or (x<y and y==z):
        v=3
      else:
        v=6
      d[key]=v

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

Submission status: Wrong Answer

Solution code:
from sys import stdin,stdout
def fn(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
'''a=list(map(int,stdin.readline().split()));ans=0
print(fn(1,1,1))
print(fn(1,1,2))
print(fn(1,2,2))
print(fn(2,2,2))
print(fn(1,1,3))'''
def bfs(n):
    q=[(1,1,1)]
    vis={}
    vis[(1,1,1)]=1
    dp[6]=1
    while q:
        x,y,z=q.pop(0)
        if fn(x,y,z)>n:return
        if (x+1,y,z) not in vis:
            dp[fn(x+1,y,z)]+=1
            vis[x+1,y,z]=1
            q+=[(x+1,y,z)]
        if (x,1+y,z) not in vis:
            dp[fn(x,y+1,z)]+=1
            vis[x,y+1,z]=1
            q+=[(x,y+1,z)]
        if (x,y,z+1) not in vis:
            dp[fn(x,y,z+1)]+=1
            vis[x,y,z+1]=1
            q+=[(x,y,z+1)]

dp=[0]*(10**4+5)
n=int(stdin.readline())
bfs(n)
for i in range(1,n+1):
    print(dp[i])

Submission status: Wrong Answer

Solution code:
def  XYZTriplets():

    num = int(input())
    
    for i in range(num):
        count = 0

        x = 1
        y = 1
        z = 1

        flag = True
        
        while flag == True:
            
            function = 0.5*( (x+y)*(x+y) + (y+z)*(y+z) + (z+x)*(z+x) ) - i
                        
            if function == 0:
                if x == y and y == z and z == x:
                    count = count + 1
                
                else:
                    count = count + 3
            
                list_xyz = [x, y, z]
            
                if list_xyz.index(max(list_xyz)) == 0:
                    x = x + 1
                elif list_xyz.index(max(list_xyz)) == 1:
                    y = y + 1
                else:
                    z = z + 1
            
            if function < 0:

                list_xyz = [x, y, z]
            
                if list_xyz.index(max(list_xyz)) == 0:
                    x = x + 1
                elif list_xyz.index(max(list_xyz)) == 1:
                    y = y + 1
                else:
                    z = z + 1
            
            if function > 0:
                print(count)
        
                break



if __name__ == '__main__':
    XYZTriplets()

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [0 for _ in range(N)]
for x in range(1, 10**2):
    for y in range(1, 10**2):
        for z in range(1, 10**2):
            m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if m <= N:
                if x == y == z:
                    l[m - 1] += 1
                elif x == y or y == z or z == x:
                    l[m - 1] = 3
                else:
                    l[m - 1] += 6
            else:
                break

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

Submission status: Wrong Answer

Solution code:
import itertools
n = int(input())
N = 1
while N**2 < n:
    N += 1
if N ** 2 > n: N-=1
ans = [0] * n

for x,y,z in itertools.combinations_with_replacement(list(range(1,N+1)), 3):
    a = x**2+y**2+z**2 + x*y+y*z+z*x
    if a > n: continue
    if x==y==z: b = 1
    elif x==y or x==z or y==z: b = 3
    else: b = 6
    ans[a-1] = b

for i in ans: print(i)

Submission status: Wrong Answer

Solution code:
def f(n):
    cnt = 0
    for x in range(1,7):
        for y in range(1, 7):
            for z in range(1,7):
                if (((x**2 )+(y**2) +(z**2) +x*y +y*z+ z*x)) == n:
                    cnt += 1

    return cnt
N=int(input())
for i in range(1,N+1):
    print(f(i))

Submission status: Wrong Answer

Solution code:
n=int(input())
from math import floor,sqrt
sqset=set()
for i in range(1,101):
  sqset.add(i**2)
def func(m):
  r=0
  for x in range(1,floor(sqrt(m))+1):
    for y in range(1,floor(sqrt(m))+1):
      a=x+y
      b=x**2+y**2+x*y-m
      d=a**2-4*b
      if d in sqset:
        if (sqrt(d)-a)>0 and (sqrt(d)-a)%2==0:
          r+=1
  return r
for i in range(1,n+1):
  print(func(i))

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
lis=[]
lim=lim=int(n**(0.5))*int(6**(0.5))//3
for x in range(1,lim+2):
    for y in range(1,lim+2):
        for z in range(1,lim+2):
            lis.append(x**2+y**2+z**2+x*y+y*z+z*x)

c=collections.Counter(lis)
for i in range(1,n+1):
    print(c[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
fn = [0] * (10**5)

def f(x, y, z):
    return x**2 + y**2 + z**2 + x*y + y*z+ z*x 
for x in range(1, 40):
    for y in range(1, 40):
        for z in range(1, 40):
            idx = f(x, y, z)
            fn[idx] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = int(n**(0.3))
for a in range(n):
  s=0
  for i in range(l):
    if((3*i+3)**2-(3*(i**2)+6*i+3)==a+1):
      s+=1
      continue
    for j in range(l-i):
      for k in range(l-i-j):
        if((i+j+k+3)**2-(i*j+j*k+k*i+2*i+2*j+2*k+3)==a+1):
          s+=1
  print(s)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n=int(input())
cnt=0
ans=[]
for i in range(2,int((2*n)**0.5)+1):
    for j in range(2,int((2*n)**0.5)+1):
        for k in range(2,int((2*n)**0.5)+1):
            if (i*i + j*j + k*k)%2==0 and (i*i + j*j + k*k)<=2*n and (i+j-k>1) and (i+k-j>1) and (k+j-i>1):
                ans.append((i*i + j*j + k*k)//2)
ans.sort()
A=Counter(ans)
for i in range(n):
    print(A[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
def sq(n):
    c=0
    A=[0 for j in range(n+1)]
    for i in range(n//2):
        p=(i+1)**2
        if p>n:
            for j in range(i**2,n+1):
                A[j]=i
            break
        else:
            for j in range(i**2,p):
                A[j]=i
    return A
A=sq(N)
for n in range(1,N+1):
    c=0
    for x in range(1,A[n]):
        p=n-x**2
        if p<0:
            break
        else:
            for y in range(1,A[p]):
                q=n-x**2-y**2-x*y
                if q<0:
                    break
                else:
                    for z in range(1,A[q]):
                        if n==x**2+y**2+z**2+x*y+y*z+z*x:
                            c=c+1
    print(c)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

def ff(N):
#     print("call ff{0}".format(N))
    if N > 100:
        n = int(np.sqrt(20))+1
    else:
        n = N
    cnt = 0
    for x in range(1, n+1):
        x2 = x**2
        for y in range(1, n+1):
            y2 = y**2
            xy = x * y
            for z in range(1, n+1):
                num = x2 + y2 + z**2 + xy + x*z + y*z
                if num > N:
                    break
                if N == num:
                    cnt += 1
    return(cnt)    

N = int(input())    
n = int(np.sqrt(20))+1
for i in range(1, N+1):
#     ff(i)
     print(ff(i))

Submission status: Wrong Answer

Solution code:
def f(n):
    res = 0
    for x in range(1, 70):
        for y in range(x, 70):
            temp = - 3 * (x + y) ** 2 + 4 * n + 4 * x * y
            if (x + y) % 2:
                continue
            elif temp < 0:
                continue
            elif format(temp, 'b').count('1') != 1:
                continue
            temp = int(temp ** .5)
            if temp % 2:
                continue
            z1 = - (x + y) // 2 + temp // 2
            z2 = - (x + y) // 2 - temp // 2
            if z1 >= 1:
                if x == y == z1:
                    res += 1
                elif x != y != z1:
                    res += 6
                else:
                    res += 3
            if z2 >= 1:
                if x == y == z2:
                    res += 1
                elif x != y != z2:
                    res += 6
                else:
                    res += 3
    return res


N = int(input())
for i in range(1, N + 1):
    print(f(i))

Submission status: Wrong Answer

Solution code:
import time
import itertools


N = int(input())
def function(x,y,z,n):
    n_tmp = pow(x+y+z,2) - (x*y) - (y*z) -(x*z)
    if n == n_tmp:
        return True
    else:
        return False


max = pow(10,4)
count = 0
start = time.time()

p = list(itertools.product(range(1,24), repeat=3))

for n in range(1,N):
    count = 0
    for p_in in p:
        if function(p_in[0],p_in[1],p_in[2],n) == True:
            count = count + 1

    print(count)



elapsed_time = time.time() - start
# print("elapsed_time:{0}".format(elapsed_time) + "[sec]")

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
n=int(input())
ans=[0]*10648
list1=list(combinations_with_replacement([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22], 3))
for i in range(len(list1)):
    x=list1[i][0]
    y=list1[i][1]
    z=list1[i][2]
    if len(list(set(list1[i])))==1:
        ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=1
    elif len(list(set(list1[i])))==2:
        ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=3
    else:
        ans[(x*x)+(y*y)+(z*z)+(x*y)+(y*z)+(x*z)-1]+=6
for i in range(n):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n+1):
    ans = 0
    for x in range(33):
        for y in range(33):
            for z in range(33):
                if (x+y+z)**2 -(x*y+y*z+z*x) == i and x>=1 and y>=1 and z>=1:
                    ans += 1
    print(ans)