ZhenlongDai/ACPR huggingface dataset:
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


N = int(input())

ANS = [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 + k*i
            if a <= N:
                ANS[a] += 1

for a in ANS:
    print(a)

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Fixed submission (verdict: Accepted):


N = int(input())

ANS = [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 + k*i
            if a <= N:
                ANS[a] += 1

for i in range(1,N+1):
    print(ANS[i])
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())

ans = [0] * (n+1)


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


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

for a in ans:
    print(a)


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0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
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Fixed submission (verdict: Accepted):
n = int(input())

ans = [0] * (n+1)


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


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

for i in range(1, n+1):
    print(ans[i])
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math

def main():
    N = int(input())
    ans = [0]*(N+1)

    rn = math.ceil(math.sqrt(N))

    for x in range(1,rn):
        for y in range(1,rn):
            for z in range(1,rn):
                k = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if k <= N:
                    ans[k-1] += 1
    
    for i in range(len(ans)):
        print(ans[i])
    
main()

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0
0


Fixed submission (verdict: Accepted):
import math

def main():
    N = int(input())
    ans = [0]*(N+1)

    rn = math.ceil(math.sqrt(N))

    for x in range(1,rn):
        for y in range(1,rn):
            for z in range(1,rn):
                k = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if k <= N:
                    ans[k-1] += 1
    
    for i in range(len(ans) - 1):
        print(ans[i])
    
main()
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
count = 0
for n in range(1, N + 1):
    for i in range(1, 31):
        for j in range(1, i + 1):
            for k in range(1, j + 1):
                if i ** 2 + j ** 1 + k ** 2 + i * j + j * k + k * i == n:
                    if i == j and j == k:
                        count += 1
                    elif i == j or j == k:
                        count += 3
                    else:
                        count += 6
    print(count)
    count = 0


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
3
0
0
3
0
0
0
1
6
0
0
0
3
3
0
0
3
0
6
0
0
0
3
3
6
0
0
3
0
0
9
0
0
1
6
0
3
6
0
0
3
3
0
0
12
0
3
0
6
0
0
6
6
0
3
3
6
0
0
0
12
3
0
0
9
0
0
0
9
7
6
0
3
6
0
0
3
0
15
3
0
0
12
0
0
0
3
9
12
0
0
6
6
0
0
0
9
3
18
0
0
0
12
0
0
6
0
0
18
6
0
0
9
6
0
1
6
0
9
6
12
0
3
0
12
0
3
3
6
0
12
9
6
0
0
9
9
0
9
0
0
6
12
0
12
0
6
0
15
3
6
0
0
6
12
0
9
9
0
3
9
6
9
0
6
0
9
6
6
0
12
1
12
0
15
9
0
0
3
0
18
0
0
9
15
3
0
9
18
0
0
0
6
9
6
0
12
0
18
0
6
6
18
0
6
0
6
0
12
6
3
3
15
12
0
0
24
6
0
3
0
0
15
9
0
0
21
0
12
0
15
6
12
0
0
6
6
1
18
3
9
6
0
9
15
0
12
9
12
0
6
0
3
12
12
0
12
0
12
0
12
12
12
0
15
0
3
0
18
0
12
6
12
6
0
0
15
12
12
0
9
6
9
9
6
0
12
6
18
0
0
3
12
0
21
6
12
3
18
0
9
0
6
6
21
6
0
6
6
0
9
9
24
4
6
9
9
6
12
0


Fixed submission (verdict: Accepted):
N = int(input())

counts = [0] * 10001
for i in range(1, 101):
    for j in range(1, i + 1):
        for k in range(1, j + 1):
            result = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            if result > 10000:
                continue
            if i == j and j == k:
                counts[result] += 1
            elif i == j or j == k:
                counts[result] += 3
            else:
                counts[result] += 6

for n in range(1, N + 1):
    print(counts[n])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

for i in range(1,n+1):
    cnt = 0
    for j in range(1, 10^2): 
        for k in range(1, 10^2): 
            for l in range(1, 10^2): 
                if j*j+k*k+l*l+j*k+k*l+l*j == i:
                      cnt += 1
    print(cnt)

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6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
0
0
0
0
0
0
0
0
3
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):
n = int(input())
ans = [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): 
            if (m:=x*x+y*y+z*z+x*y+y*z+z*x) <= n:
                
                ans[m] += 1

for i in range(n):
    print(ans[i+1])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
def I(): return int(sys.stdin.readline().rstrip())

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

def Main():
    n = I()
    c = [0]*n
    fa = True
    for i in range(1,n+1):
        for j in range(1,n+1):
            tmp = f(i,i,j)
            if n<tmp:
                if j==1:
                    fa = False
                break
            if j==i:
                d = 1
            else:
                d = 3
            c[tmp-1] += d
        
        if not fa:
            break

    for rep in c:
        print(rep)
    return

if __name__=='__main__':
    Main()

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
0
0
3
0
0
0
0
0
3
3
0
0
0
3
0
0
0
0
3
3
0
0
0
0
0
0
3
0
0
1
0
0
6
0
0
0
0
0
0
0
0
3
3
3
0
0
0
3
0
0
0
0
0
0
0
0
3
3
3
0
0
3
0
0
3
0
0
0
0
0
0
1
0
0
6
0
0
3
0
0
0
0
0
3
0
0
0
0
3
3
0
0
0
3
0
0
3
0
3
0
0
0
0
0
3
0
3
3
0
0
0
3
0
0
3
0
0
0
0
0
0
3
0
0
0
1
0
3
6
0
0
0
0
0
0
0
0
6
0
0
0
0
0
0
0
0
6
3
0
0
0
3
3
0
3
0
0
0
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
6
0
0
3
0
0
3
0
0
0
0
3
0
0
0
0
3
0
1
0
0
6
0
0
0
0
0
0
0
3
6
0
0
0
0
3
0
0
0
0
0
0
0
3
3
3
0
0
3
0
0
3
0
0
0
0
0
0
0
3
3
0
0
0
3
0
3
0
0
3
3
0
0
0
3
0
3
3
0
0
0
0
0
0
0
3
0
0
0
0
3
0
0
3
0
0
1
0
0
9
0
0
0
0
0
0
0
0
6
3
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0
3
3
0
3
0
3
0
0
3
3
0
0


Fixed submission (verdict: Accepted):
import sys
def I(): return int(sys.stdin.readline().rstrip())

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

def Main():
    n = I()
    c = [0]*n
    fa = True
    for i in range(1,n+1):
        if n<f(i,1,1):  break
        for j in range(1,n+1):
            if n<f(i,j,1):  break
            for k in range(1,n+1):
                tmp = f(i,j,k)
                if n<tmp:   break
                c[tmp-1] += 1

    for rep in c:
        print(rep)
    return

if __name__=='__main__':
    Main()
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
N = int(input())
A = 8
for n in range(1, N+1):
    num = 0
    for i in range(1, A):
        for j in range(1, A):
            for k in range(1, A):
                if math.pow(i + j + k, 2) == (i * j + j * k + k * i) + n:
                    num += 1
    print(num)


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
6
0
6
3
6
0
3
6
0
0
0
0
0
1
6
0
6
6
0
0
12
0
6
0
0
0
0
0
0
0
3
3
6
0
6
3
6
0
3
6
0
0
0
0
0
0
0
0
3
3
6
0
6
3
6
0
0
0
6
0
0
0
0
0
0
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
0
0
0
0
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
6
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):

n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            v = i*i+j*j+k*k+i*j+j*k+k*i
            if v < 10050:  
                ans[v] += 1
for i in range(n):
    print(ans[i+1])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
r = range(1,101)
l = [0]*n

for x in r:
    for y in r:
        for z in r:
            t = x*x+y*y+z*z+y*z+z*x+x*y
            if t == n:
                l[t-1] +=1
for i in l:
    print(i)



Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
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0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):
n = int(input())
r = range(1,101)
l = [0]*n

for x in r:
    for y in r:
        for z in r:
            t = x*x+y*y+z*z+y*z+z*x+x*y
            if t <= n:
                l[t-1] +=1
for i in l:
    print(i)
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
from itertools import product, combinations_with_replacement
import math
input = sys.stdin.readline



N = int(input())
d = {}

combs = list(combinations_with_replacement(range(1, int(math.sqrt(10001))), 3))
for c in combs:
    x, y, z = c
    calc = x**2 + y**2 + z**2 +x*y +z*y + x*z
    if  x == y and y == z:
        d[calc] = 1
    elif x== y or x == z or y == z:
        d[calc] = 3
    else:
        d[calc] = 6


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


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
3
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
6
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
3
6
0
3
6
0
6
0
0
3
6
0
0
0
3
3
6
0
6
3
6
0
3
6
6
0
6
0
0
0
3
6
3
3
6
0
6
3
6
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
3
6
0
0
6
0
6
0
6
3
6
0
0
6
0
0
6
0
3
3
6
0
6
3
6
6
3
6
6
0
6
0
6
0
3
6
0
0
6
0
3
3
6
0
6
3
6
0
3
6
6
3
6
0
6
0
6
6
0
0
6
3
6
1
6
6
3
6
0
0
6
0
6
0
3
3
6
0
0
6
3
6
6
0
6
0
0
0
3
3
6
6
6
3
6
0
3
6
6
0
6
0
6
0
3
6
0
0
6
3
6
3
6
6
3
3
6
0
6
3
6
3
3
6
6
6
6
0
6
0
6
6
6
0
6
3
6
0
6
6
6
1
6
0
3
6
6
0
6
0
6
0
0
3
6
6
0
6
6
0
6
0
6
0
0
0
6
0
3
6
3
3
6
3
6
3
6
6
3
6
6
0


Fixed submission (verdict: Accepted):
import sys
from itertools import product, combinations_with_replacement
import math
from collections import defaultdict
input = sys.stdin.readline



N = int(input())
d = defaultdict(int)

combs = list(combinations_with_replacement(range(1, int(math.sqrt(10001))), 3))
for c in combs:
    x, y, z = c
    calc = x**2 + y**2 + z**2 +x*y +z*y + x*z
    
    if  x == y and y == z:
        d[calc] += 1
    elif x== y or x == z or y == z:
        d[calc] += 3
    else:
        d[calc] += 6


for i in range(1, N+1):
    if i in d:
        print(d[i])
    else:
        print(0)
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


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

    for i in ans:
        print(i)    

if __name__ == "__main__":
    main() 

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Fixed submission (verdict: Accepted):


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

if __name__ == "__main__":
    main()
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def func(a, b, c):
    return a**2 + b**2 + c**2 + a*b + b*c + c*a

n = int(input())
ans = [0]*(n+1)
x, y, z = (1, 1, 1)
flag = 0
while flag == 0:
    for y in range(1, x+1):
        for z in range(1, y+1):
            num = func(x, y, z)
            if num <= n and x == y == z:
                ans[num] += 1
            elif num <= n:
                ans[num] += 3
    if func(x-1, 1, 1) > n:
        flag = 1
    x += 1

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


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
3
0
3
0
0
0
0
0
3
3
3
0
0
3
0
0
0
0
3
3
3
0
3
0
0
0
3
0
0
1
3
0
6
3
0
0
3
0
0
0
0
3
3
3
3
0
3
3
3
0
0
0
3
0
0
0
3
3
6
0
3
3
3
0
3
3
0
0
0
0
3
1
3
0
6
3
0
3
6
0
3
0
0
3
3
0
0
0
3
3
6
0
3
3
3
0
3
3
6
0
3
0
0
0
3
3
3
3
3
0
3
3
6
0
3
3
3
0
3
0
3
3
3
0
0
1
3
3
9
3
0
0
6
0
3
0
3
6
6
0
0
3
0
0
3
0
9
3
3
0
3
3
6
3
3
3
3
0
3
0
3
0
9
3
0
0
3
0
3
3
6
0
6
6
3
0
3
3
3
3
6
0
3
0
6
3
0
0
3
3
6
1
3
3
6
3
0
0
9
0
6
0
3
6
6
0
0
3
3
3
6
0
6
0
0
0
6
3
6
3
6
3
6
0
3
3
3
0
6
0
6
0
6
6
0
0
3
3
3
3
6
3
6
3
3
0
6
3
3
3
6
3
6
3
3
0
3
0
6
3
3
0
6
3
3
0
6
3
3
1
3
0
15
6
3
0
6
0
6
0
0
6
9
3
0
3
6
0
6
0
6
0
0
0
6
0
9
6
3
3
9
3
3
3
3
3
6
6
9
0


Fixed submission (verdict: Accepted):
def func(a, b, c):
    return a**2 + b**2 + c**2 + a*b + b*c + c*a

n = int(input())
ans = [0]*(n+1)
x, y, z = (1, 1, 1)
flag = 0
while flag == 0:
    if func(x, 1, 1) <= n:
        for y in range(1, x+1):
            for z in range(1, y+1):
                num = func(x, y, z)
                if num <= n and x == y == z:
                    ans[num] += 1
                elif num <= n and (x == y or y == z or z == x):
                    ans[num] += 3
                elif num <= n:
                    ans[num] += 6
    else:
        flag = 1
    x += 1

for i in range(1, n+1):
    print(ans[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
num=1
while True:
    if (num*num)*6>n:
        break
    num=num+1
num=2*num
d={}
for i in range(1,n+1):
    d[i]=0
for i in range(1,num+1):
    for j in range(1,num+1):
        for k in range(1,num+1):
            val=(i*i)+(j*j)+(k*k)+(i*j)+(j*k)+(k*i)
            if val>n:
                continue
            d[val]=d[val]+1
for i in range(1,n+1):
    print(d[i])

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
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6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
0
6
3
6
6
9
9
18
0


Fixed submission (verdict: Accepted):
n=int(input())
num=100
d={}
for i in range(1,n+1):
    d[i]=0
for i in range(1,num+1):
    for j in range(1,num+1):
        for k in range(1,num+1):
            val=(i*i)+(j*j)+(k*k)+(i*j)+(j*k)+(k*i)
            if val>n:
                continue
            
            
            
            d[val]=d[val]+1
for i in range(1,n+1):
    print(d[i])
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def main():
    import sys
    N=int(sys.stdin.readline())
    L=[0]*(10**4+1)
    for x in range(1,1000):
        for y in range(x,1000):
            for z in range(y,1000):
                r=x**2+y**2+z**2+x*y+y*z+z*x
                if r>10**4:
                    break
                
                c=len(set((x,y,z)))
                if c==3:
                    L[r]+=6
                elif c==2:
                    L[r]+=3
                elif c==1:
                    L[r]+=1


    for t in L[1:N]:
        print(t)
main()

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0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
0
12
12
3
3
18
3
6
3
6
6
9
9
18


Fixed submission (verdict: Accepted):
def main():
    import sys
    N=int(sys.stdin.readline())
    L=[0]*(10**4+1)
    for x in range(1,1000):
        for y in range(x,1000):
            for z in range(y,1000):
                r=x**2+y**2+z**2+x*y+y*z+z*x
                if r>10**4:
                    break
                
                c=len(set((x,y,z)))
                if c==3:
                    L[r]+=6
                elif c==2:
                    L[r]+=3
                elif c==1:
                    L[r]+=1


    for t in L[1:N+1]:
        print(t)

main()
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N/2))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

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


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
3
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
6
1
6
6
6
6
0
0
18
0
12
0
0
6
12
0
0
6
0
0
12
0
12
0
0
0
9
3
9
6
6
3
12
0
3
6
6
0
6
0
6
0
9
6
0
0
6
3
6
0
6
6
9
3
6
0
12
3
6
0
3
6
6
0
6
0
6
0
9
6
0
0
6
3
6
0
6
6
6
1
6
0
12
6
0
0
12
0
6
0
0
6
12
0
0
6
0
0
12
0
12
0
0
0
6
0
3
6
3
3
12
0
6
3
6
0
3
6
6
0


Fixed submission (verdict: Accepted):
import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

            
for i in range(1,N+1):
    print(anslist[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
N = int(input())
for i in range(1, N+1):
    ans = 0
    for x in range(1, round(math.pow(i, 1/3))):
        for y in range(1, round(math.pow(i, 1/3))):
            for z in range(1, round(math.pow(i, 1/3))):
                tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
                if tmp == i:
                    ans += 1
    print(ans)

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):
N = int(input())

ans = [0 for _ in range(10**4+50)]

for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp < 10**4+50:
                ans[tmp] += 1

for i in range(1, N+1):
    print(ans[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math



N=int(input())

for i in range(1,N+1):
    ans=0
    if i<=5:
        print(0)
    else:
        ma=int(math.sqrt(i)/6)
        for x in range(1,ma):
            for y in range(x,ma):
                for z in range(y,ma):
                    if x**2+y**2+z**2+x*y+y*z+z*x==i:
                        if x==y and y==z:
                            ans+=1
                        elif x==y or y==z or z==x:
                            ans+=3
                        else:
                            ans+=6
            
    print(ans)



Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
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0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0


Fixed submission (verdict: Accepted):
import math




N=int(input())

anslist=[0]*(N+1)
ma=int(math.sqrt(N))+1
for x in range(1,ma):
    for y in range(x,ma):
        for z in range(y,ma):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n <=N:
                if x==y and y==z:
                    anslist[n]+=1
                elif x==y or y==z or z==x:
                    anslist[n]+=3
                else:
                    anslist[n]+=6

            
for i in range(1,N+1):
    print(anslist[i])
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):



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

n = int(input())
















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





Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0 0 0 0 0 0 1 0 0 0 0 3 0 0 0 0 0 3 3 0 0 0 0 0 1 6 0 3 0 0 0 0 0 3 3 6 0 0 3 0 0 0 0 3 3 6 0 6 0 0 0 3 0 0 1 6 0 6 6 0 0 6 0 0 0 0 3 3 3 6 0 6 3 6 0 0 0 6 0 0 0 3 3 9 0 6 3 6 0 3 6 0 0 0 0 6 1 6 0 6 6 0 3 12 0 6 0 0 3 6 0 0 0 3 3 12 0 6 3 6 0 3 6 9 0 6 0 0 0 3 6 3 3 6 0 6 3 12 0 3 6 6 0 6 0 6 3 6 0 0 1 6 3 12 6 0 0 12 0 6 0 6 6 12 0 0 6 0 0 6 0 12 3 6 0 6 3 9 6 3 6 6 0 6 0 6 0 15 6 0 0 6 0 3 3 12 0 12 6 6 0 3 6 6 3 12 0 6 0 9 6 0 0 6 3 12 1 6 6 6 6 0 0 18 0 12 0 3 6 12 0 0 6 3 6 12 0 12 0 0 0 9 3 9 6 12 3 12 0 3 6 6 0 12 0 12 0 9 9 0 0 6 3 6 3 12 6 9 3 6 0 12 3 6 3 9 6 12 6 6 0 6 0 9 6 6 0 12 3 6 0 9 6 6 1 6 0 21 12 6 0 12 0 12 0 0 6 15 6 0 6 12 0 12 0 12 0 0 0 12 0 12 12 3 3 18 3 6 3 6 6 9 9 18 0


Fixed submission (verdict: Accepted):



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

n = int(input())
















ans = [0] * (n+1)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            cal = i**2+j**2+k**2+i*j+j*k+k*i
            if cal <= n:
                ans[cal] += 1
for i in range(1, n+1):
    print(ans[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
num = [0]*N
for i in range(1,10**2):
    for j in range(1,10**2):
        for k in range(1,10**2):
            ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if ans < N:
                num[ans] += 1
for i in range(N):
    print(num[i])


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18


Fixed submission (verdict: Accepted):
N = int(input())
num = [0]*N
for i in range(1,10**2 + 1):
    for j in range(1,10**2 + 1):
        for k in range(1,10**2 + 1):
            ans = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if ans <= N:
                num[ans - 1] += 1
for i in range(N):
    print(num[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
list_ = [0]*1000000
for i in range(100):
   for j in range(100):
       for k in range(100):
           list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1
for i in range(n):
    print(list_[i])


Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0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
1
18
6
12
6
0
0
24
0
15
0
3
12
18
0
0
6
3
6
12
0
18
0
0
0
15
3
12
12
12
3
24
0
3
6
6
6
12
0
12
3
9
9
12
0
6
3
6
3
12
6
9
9
6
0
18
3
18
3
9
6
18
6
12
0
6
0
15
6
6
0
12
3
9
0
15
12
6
1
6
0
21
12
6
3
24
0
12
6
0
6
21
6
6
6
12
0
18
0
12
6
0
0
12
0
12
12
3
6
24
3
12
3
6
6
15
9
24
0


Fixed submission (verdict: Accepted):
n = int(input())
list_ = [0]*1000000
for i in range(1,100):
   for j in range(1,100):
       for k in range(1,100):
           list_[i**2 + j**2 + k**2+i*j+j*k+k*i - 1] += 1
for i in range(n):
    print(list_[i])
Problem: p02608
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
count=[0]*(10**4+1)
for x in range(1,10**2):
    for y in range(1,10**2):
        for z in range(1,10**2):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n<=10**4:
                count[n]+=1
for i in range(1,N):
    print(count[i])

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18


Fixed submission (verdict: Accepted):
N=int(input())
count=[0]*(10**4+1)
for x in range(1,10**2):
    for y in range(1,10**2):
        for z in range(1,10**2):
            n=x**2+y**2+z**2+x*y+y*z+z*x
            if n<=10**4:
                count[n]+=1
for i in range(1,N+1):
    print(count[i])
Problem: p02608
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
ans=0
for i in range(1,n+1):
  cnt=0
  for x in range(1,101):
    if x**2>i:
      break
    for y in range(1,x+1):
      if x**2+y**2>i:
        break
      for z in range(1,y+1):
        if x**2+y**2+z**2+x*y+y*z+z*x==i:
          cnt+=3
  ans=cnt
  if i==6:
    ans=1
  print(ans) 

Failing test case input:
334

Expected output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
1
6
0
3
0
0
0
0
0
3
3
6
0
0
3
0
0
0
0
3
3
6
0
6
0
0
0
3
0
0
1
6
0
6
6
0
0
6
0
0
0
0
3
3
3
6
0
6
3
6
0
0
0
6
0
0
0
3
3
9
0
6
3
6
0
3
6
0
0
0
0
6
1
6
0
6
6
0
3
12
0
6
0
0
3
6
0
0
0
3
3
12
0
6
3
6
0
3
6
9
0
6
0
0
0
3
6
3
3
6
0
6
3
12
0
3
6
6
0
6
0
6
3
6
0
0
1
6
3
12
6
0
0
12
0
6
0
6
6
12
0
0
6
0
0
6
0
12
3
6
0
6
3
9
6
3
6
6
0
6
0
6
0
15
6
0
0
6
0
3
3
12
0
12
6
6
0
3
6
6
3
12
0
6
0
9
6
0
0
6
3
12
1
6
6
6
6
0
0
18
0
12
0
3
6
12
0
0
6
3
6
12
0
12
0
0
0
9
3
9
6
12
3
12
0
3
6
6
0
12
0
12
0
9
9
0
0
6
3
6
3
12
6
9
3
6
0
12
3
6
3
9
6
12
6
6
0
6
0
9
6
6
0
12
3
6
0
9
6
6
1
6
0
21
12
6
0
12
0
12
0
0
6
15
6
0
6
12
0
12
0
12
0
0
0
12
0
12
12
3
3
18
3
6
3
6
6
9
9
18
0


Actual output:
0
0
0
0
0
1
0
0
0
0
3
0
0
0
0
0
3
3
0
0
0
0
0
3
3
0
3
0
0
0
0
0
3
3
3
0
0
3
0
0
0
0
3
3
3
0
3
0
0
0
3
0
0
3
3
0
6
3
0
0
3
0
0
0
0
3
3
3
3
0
3
3
3
0
0
0
3
0
0
0
3
3
6
0
3
3
3
0
3
3
0
0
0
0
3
3
3
0
6
3
0
3
6
0
3
0
0
3
3
0
0
0
3
3
6
0
3
3
3
0
3
3
6
0
3
0
0
0
3
3
3
3
3
0
3
3
6
0
3
3
3
0
3
0
3
3
3
0
0
3
3
3
9
3
0
0
6
0
3
0
3
6
6
0
0
3
0
0
3
0
9
3
3
0
3
3
6
3
3
3
3
0
3
0
3
0
9
3
0
0
3
0
3
3
6
0
6
6
3
0
3
3
3
3
6
0
3
0
6
3
0
0
3
3
6
3
3
3
6
3
0
0
9
0
6
0
3
6
6
0
0
3
3
3
6
0
6
0
0
0
6
3
6
3
6
3
6
0
3
3
3
0
6
0
6
0
6
6
0
0
3
3
3
3
6
3
6
3
3
0
6
3
3
3
6
3
6
3
3
0
3
0
6
3
3
0
6
3
3
0
6
3
3
3
3
0
15
6
3
0
6
0
6
0
0
6
9
3
0
3
6
0
6
0
6
0
0
0
6
0
9
6
3
3
9
3
3
3
3
3
6
6
9
0


Fixed submission (verdict: Accepted):
n=int(input())
ans=0
for i in range(1,n+1):
  cnt=0
  for x in range(1,101):
    if x**2>i:
      break
    for y in range(1,x+1):
      if x**2+y**2>i:
        break
      for z in range(1,y+1):
        if x**2+y**2+z**2+x*y+y*z+z*x==i:
          if x==y==z:
            cnt+=1
          if (x>y and y==z) or (x==y and y>z):
            cnt+=3
          if x>y>z:
            cnt+=6
  ans=cnt
  print(ans)