Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N-1]+1):
            tempx = x**2
            for y in range(x, mylist[N-x**2]+1):
                tempy = y**2
                tempxy = x*y
                if N-tempx-tempy-tempxy < 0:
                    break
                else:
                    for z in range(y, mylist[N-tempx-tempy-tempxy]+1):
                        if tempx + tempy + z**2 + tempxy + y*z + z*x == N:
                            if x != y and y != z:
                                result += 6
                            elif x == y and y == z:
                                result += 1
                            else:
                                result += 3
                        elif tempx + tempy + z**2 + tempxy + y*z + z*x > N:
                            break
        print(result)
main()

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N-1]+1):
            tempx = x**2
            for y in range(x, mylist[N-x**2]+1):
                tempy = y**2
                tempxy = x*y
                if N-tempx-tempy-tempxy < 0:
                    break
                else:
                    for z in range(y, mylist[N-tempx-tempy-tempxy]+1):
                        if tempx + tempy + z**2 + tempxy + y*z + z*x == N:
                            if x != y and y != z:
                                result += 6
                            elif x == y and y == z:
                                result += 1
                            else:
                                result += 3
                        elif tempx + tempy + z**2 + tempxy + y*z + z*x > N:
                            break
        print(result)
main()

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N-1]+1):
            tempx = x**2
            for y in range(1, mylist[N-x**2]+1):
                tempy = y**2
                tempxy = x*y
                if N-tempx-tempy-tempxy < 0:
                    break
                else:
                    for z in range(1, mylist[N-tempx-tempy-tempxy]+1):
                        if tempx + tempy + z**2 + tempxy + y*z + z*x == N:
                            result += 1
                        elif tempx + tempy + z**2 + tempxy + y*z + z*x > N:
                            break
        print(result)
main()

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N-1]+1):
            tempx = x**2
            for y in range(1, mylist[N-x**2]+1):
                tempy = y**2
                tempxy = x*y
                if N-tempx-tempy-tempxy < 0:
                    break
                else:
                    for z in range(1, mylist[N-tempx-tempy-tempxy]+1):
                        if tempx + tempy + z**2 + tempxy + y*z + z*x == N:
                            result += 1
                        elif tempx + tempy + z**2 + tempxy + y*z + z*x > N:
                            break
        print(result)
main()

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

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

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,int(math.sqrt(N))+1):
            tempx = x**2
            for y in range(1, int(math.sqrt(N-x**2))+1):
                tempy = y**2
                tempxy = x*y
                if N-tempx-tempy-tempxy < 0:
                    break
                else:
                    for z in range(1, int(math.sqrt(N-tempx-tempy-tempxy))+1):
                        if tempx + tempy + z**2 + tempxy + y*z + z*x == N:
                            result += 1
                        elif tempx + tempy + z**2 + tempxy + y*z + z*x > N:
                            break
        print(result)
main()

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

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

for N in range(1,n+1):
    result = 0
    for x in range(1,int(math.sqrt(N))+1):
        tempx = x**2
        for y in range(1, int(math.sqrt(N-x**2))+1):
            tempy = y**2
            tempxy = x*y
            if N-tempx-tempy-tempxy < 0:
                break
            else:
                for z in range(1, int(math.sqrt(N-tempx-tempy-tempxy))+1):
                    if tempx + tempy + z**2 + tempxy + y*z + z*x == N:
                        result += 1
                    elif tempx + tempy + z**2 + tempxy + y*z + z*x > N:
                        break
    print(result)

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

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

for N in range(1,n+1):
    result = 0
    for x in range(1,int(math.sqrt(N))+1):
        for y in range(1, int(math.sqrt(N-x**2))+1):
            if N-x**2-y**2-x*y < 0:
                break
            else:
                for z in range(1, int(math.sqrt(N-x**2-y**2-x*y))+1):
                    if x**2 + y**2 + z**2 + x*y + y*z + z*x == N:
                        result += 1
                    elif x**2 + y**2 + z**2 + x*y + y*z + z*x > N:
                        break
    print(result)

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()

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

for N in range(1,n+1):
    result = 0
    for x in range(1,int(math.sqrt(N))+1):
        for y in range(1, int(math.sqrt(N-x**2))+1):
            if N-x**2-y**2 >= 1:
                for z in range(1, int(math.sqrt(N-x**2-y**2))+1):
                    if x**2 + y**2 + z**2 + x*y + y*z + z*x == N:
                        result += 1
                    elif x**2 + y**2 + z**2 + x*y + y*z + z*x > N:
                        break
    print(result)

Fixed submission:
import math
n = int(input())
mylist = [int(math.sqrt(i)) for i in range(1,n+1)]
mylist = [0]+mylist

def main():
    for N in range(1,n+1):
        result = 0
        for x in range(1,mylist[N//3]+1):
            tempx = x**2
            for y in range(x, mylist[(N-x**2)//2]+1):
                tempy = y**2
                tempxy = x*y
                tempxandy = (x+y)/2
                tempnum = N-tempx-tempy-tempxy+tempxandy**2
                if tempnum <= 0:
                    break
                else:
                    if math.sqrt(tempnum)*2 == int(math.sqrt(tempnum)*2):
                        z = math.sqrt(tempnum)-tempxandy
                        #print(x,y,z,N)
                        if z < y:
                            break
                        elif x != y and y != z:
                            result += 6
                        elif x == y and y == z:
                            result += 1
                        else:
                            result += 3
        print(result)
main()