Buggy python submission (verdict: Runtime Error):
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
for j in range(0,n):
    for k in range(j+1,n):
        for n in range(d):
            sum_ans = sum_ans+(int(x[j][n]) - int(x[k][n])) **2
        if math.sqrt(sum_ans)%1==0:
            count=count+1
        sum_ans=0
print(count)

Fixed submission:
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
print
for j in range(0,n-1):
    for k in range(j+1,n):
        for l in range(d):
            sum_ans = sum_ans+(int(x[j][l]) - int(x[k][l])) **2
        if math.sqrt(sum_ans)%1==0.0:
            count=count+1
        sum_ans=0
print(count)

Buggy python submission (verdict: Runtime Error):
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
for j in range(0,n-1):
    for k in range(j+1,n-1):
        for n in range(d):
            sum_ans = sum_ans+(x[j][n] - x[k][n]) **2
        if math.sqrt(sum_ans)%1==0:
            count=count+1
        sum_ans=0
print(sum_ans)

Fixed submission:
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
print
for j in range(0,n-1):
    for k in range(j+1,n):
        for l in range(d):
            sum_ans = sum_ans+(int(x[j][l]) - int(x[k][l])) **2
        if math.sqrt(sum_ans)%1==0.0:
            count=count+1
        sum_ans=0
print(count)

Buggy python submission (verdict: Runtime Error):
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
for j in range(0,n):
    for k in range(j+1,n):
        for n in range(d):
            sum_ans = sum_ans+(x[j][n] - x[k][n]) **2
        if math.sqrt(sum_ans)%1==0:
            count=count+1
        sum_ans=0
print(sum_ans)

Fixed submission:
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
print
for j in range(0,n-1):
    for k in range(j+1,n):
        for l in range(d):
            sum_ans = sum_ans+(int(x[j][l]) - int(x[k][l])) **2
        if math.sqrt(sum_ans)%1==0.0:
            count=count+1
        sum_ans=0
print(count)

Buggy python submission (verdict: Runtime Error):
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
for j in range(0,n):
    for k in range(j+1,n-1):
        for n in range(d):
            sum_ans = sum_ans+(x[j][n] - x[k][n]) **2
        if math.sqrt(sum_ans)%1==0:
            count=count+1
        sum_ans=0
print(sum_ans)

Fixed submission:
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
print
for j in range(0,n-1):
    for k in range(j+1,n):
        for l in range(d):
            sum_ans = sum_ans+(int(x[j][l]) - int(x[k][l])) **2
        if math.sqrt(sum_ans)%1==0.0:
            count=count+1
        sum_ans=0
print(count)

Buggy python submission (verdict: Runtime Error):
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
for j in range(0.n-2):
    for k in range(j+1.n-1):
        for n in range(d):
            sum_ans = sum_ans+(x[j][n] - x[k][n]) **2
        if math.sqrt(sum_ans)%1==0:
            count=count+1
        sum_ans=0
print(sum_ans)


Fixed submission:
import math
n, d= (int(c) for c in input().split())

x = []

for i in range(n): 
    x.append(input().split())

sum_ans = 0
count=0
print
for j in range(0,n-1):
    for k in range(j+1,n):
        for l in range(d):
            sum_ans = sum_ans+(int(x[j][l]) - int(x[k][l])) **2
        if math.sqrt(sum_ans)%1==0.0:
            count=count+1
        sum_ans=0
print(count)