Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(1, m+1):
            k = n - (x * x + y * y + x * y)
            if k < 1:
                break
            l = 1
            r = m+1
            while r - l > 1:
                z = (r + l) // 2
                tmp = (x + y + z) * z
                if tmp <= k:
                    l = z
                else:
                    if r == z + 1:
                        r -= 1
                    else:
                        r = z + 1
            if (x+y+l) * l == k:
                res += 1
    return res


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


Fixed submission:
import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(x, m+1):
            k = n - (x * x + y * y + x * y)
            if k < 1:
                break
            l = y
            r = m+1
            while r - l > 1:
                z = (r + l) // 2
                tmp = (x + y + z) * z
                if tmp <= k:
                    l = z
                else:
                    if r == z + 1:
                        r -= 1
                    else:
                        r = z + 1
            if (x+y+l) * l == k:
                s = set()
                s.add(x)
                s.add(y)
                s.add(l)
                if len(s) == 3:
                    res += 6
                elif len(s) == 2:
                    res += 3
                else:
                    res += 1
    return res


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

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(1, m+1):
            for z in range(1, m+1):
                tmp = x*x + y * y + z*z + x * y + y*z + z*x
                if tmp == n:
                    res += 1
                elif tmp > n:
                    break
    return res


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


Fixed submission:
import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(x, m+1):
            k = n - (x * x + y * y + x * y)
            if k < 1:
                break
            l = y
            r = m+1
            while r - l > 1:
                z = (r + l) // 2
                tmp = (x + y + z) * z
                if tmp <= k:
                    l = z
                else:
                    if r == z + 1:
                        r -= 1
                    else:
                        r = z + 1
            if (x+y+l) * l == k:
                s = set()
                s.add(x)
                s.add(y)
                s.add(l)
                if len(s) == 3:
                    res += 6
                elif len(s) == 2:
                    res += 3
                else:
                    res += 1
    return res


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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())


def f(n):
    res = 0
    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 == n:
                    res += 1
                elif tmp > n:
                    break
    return res


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


Fixed submission:
import math
N = int(input())


def f(n):
    m = int(math.sqrt(n)+0.5)
    res = 0
    for x in range(1, m+1):
        for y in range(x, m+1):
            k = n - (x * x + y * y + x * y)
            if k < 1:
                break
            l = y
            r = m+1
            while r - l > 1:
                z = (r + l) // 2
                tmp = (x + y + z) * z
                if tmp <= k:
                    l = z
                else:
                    if r == z + 1:
                        r -= 1
                    else:
                        r = z + 1
            if (x+y+l) * l == k:
                s = set()
                s.add(x)
                s.add(y)
                s.add(l)
                if len(s) == 3:
                    res += 6
                elif len(s) == 2:
                    res += 3
                else:
                    res += 1
    return res


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