Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = int(input())
2a = 3 * (a ** a)
 
print (2a)

Fixed submission:
r = int(input())
print(3*r*r)

Buggy python submission (verdict: Runtime Error):
a = input()
b = 3 * (a ** a)
 
print (b)

Fixed submission:
r = int(input())
print(3*r*r)

Buggy python submission (verdict: Runtime Error):
a = input()
2a = 3 * (a ** a)

print (2a)


Fixed submission:
r = int(input())
print(3*r*r)

Buggy python submission (verdict: Runtime Error):
r = input()
print(3*r**2)

Fixed submission:
r = int(input())
print(3*r*r)
Buggy python submission (verdict: Runtime Error):
import math
N,D=input().split()
print(math.ceil(N/(D*2+1)))

Fixed submission:
import math
N,D=map(int,input().split())
print(math.ceil(N/(D*2+1)))
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int(),input().strip())

A = A * N

if (A < B):
	print(A)
else:
	print(B)
	


Fixed submission:
N,A,B = map(int, input().split())

A = A * N

if (A < B):
	print(A)
else:
	print(B)

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int().input().strip())

A = A * N

if (A < B):
	print(A)
else:
	print(B)
	


Fixed submission:
N,A,B = map(int, input().split())

A = A * N

if (A < B):
	print(A)
else:
	print(B)

Buggy python submission (verdict: Runtime Error):
N,A,B = map(int(),input(),strip())

A = A * N

if (A < B):
	print(A)
else:
	print(B)
	


Fixed submission:
N,A,B = map(int, input().split())

A = A * N

if (A < B):
	print(A)
else:
	print(B)
Buggy python submission (verdict: Runtime Error):
N, D = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for _ in range(N)]
 
ans = 0
for i in range(N):
    for j in range(i+1, N):
        yz = [abs((y - z)**2) for y, z in zip(X[i], X[j])]
        v = math.sqrt(sum(yz))
        if v == int(v):
            ans += 1
            
print(ans)

Fixed submission:
import math
N, D = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for _ in range(N)]
 
ans = 0
for i in range(N):
    for j in range(i+1, N):
        yz = [abs((y - z)**2) for y, z in zip(X[i], X[j])]
        v = math.sqrt(sum(yz))
        if v == int(v):
            ans += 1
            
print(ans)

Buggy python submission (verdict: Runtime Error):
N, D = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for _ in range(N)]
 
ans = 0
for i in range(N):
    for j in range(i+1, N):
        yz = [abs((y - z)**2) for y, z in zip(X[i], X[j])]
        v = math.sqrt(sum(yz))
        if v == int(v):
            ans += 1
            
print(ans)

Fixed submission:
import math
N, D = [int(i) for i in input().split()]
X = [[int(i) for i in input().split()] for _ in range(N)]
 
ans = 0
for i in range(N):
    for j in range(i+1, N):
        yz = [abs((y - z)**2) for y, z in zip(X[i], X[j])]
        v = math.sqrt(sum(yz))
        if v == int(v):
            ans += 1
            
print(ans)
Buggy python submission (verdict: Runtime Error):
b=input()
if "A" = b:
  print("T")
elif b = "T":
  print("A")
elif b = "G":
  print("C")
elif b = "C":
  print("G")

Fixed submission:
b=input()
if "A" == b:
  print("T")
elif b == "T":
  print("A")
elif b == "G":
  print("C")
elif b == "C":
  print("G")
Buggy python submission (verdict: Runtime Error):
A, B, C=map(int,input().split())
if A+B >= C:
  ptint('Yes')
else:
  print('No')

Fixed submission:
A, B, C=map(int,input().split())
if A+B >= C:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for j in range(M)]
score = []
set_s_t=set(s)&set(t)
lst_s_t=list(set_s_t)
for k in lst_s_t:
  b=s.count(k)
  r=t.count(k)
  score.append(b-r)
if max(score)>0:
  print(max(score))
else:
  print(0)

Fixed submission:
N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for j in range(M)]
score = []
lst_s_t=list(set(s)|set(t))
for k in lst_s_t:
  score.append(s.count(k)-t.count(k))
if max(score)>0:
  print(max(score))
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for j in range(M)]
score = []
set_s_t=set(s)&set(t)
lst_s_t=list(set_s_t)
for k in lst_s_t:
  b=s.count(k)
  r=t.count(k)
  score.append(b-r)
print(max(score))

Fixed submission:
N=int(input())
s=[input() for i in range(N)]
M=int(input())
t=[input() for j in range(M)]
score = []
lst_s_t=list(set(s)|set(t))
for k in lst_s_t:
  score.append(s.count(k)-t.count(k))
if max(score)>0:
  print(max(score))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input().split())
n=0
for i in range(A:B+1):
  s = str(i)
  if s[0]==s[4] and s[1]==s[3]:
    n+=1
print(n)

Fixed submission:
A, B = map(int,input().split())
n=0
for i in range(A,B+1):
  s = str(i)
  if s[0]==s[4] and s[1]==s[3]:
    n+=1
print(n)
Buggy python submission (verdict: Runtime Error):
a = int(input())
n = input()

if a >= 3200:
  print(s)
else:
  print("red")

Fixed submission:
a = int(input())
s = input()

if a >=3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
S, N = map(int, input().split())
S[N-1] = S[N-1].lower()
print(S)

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:])

Buggy python submission (verdict: Runtime Error):
S, N = map(int, input().split())
S[N-1] = S[N-1].lower()
print()

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:])
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())

if a*n>=b:
  print(a*n)
else:
  prinb(b)

Fixed submission:
n,a,b = map(int,input().split())

if a*n <= b:
  print(a*n)
else:
  print(b)
Buggy python submission (verdict: Time Limit Exceeded):
INPUT = [int(i) for i in input().split(" ")]

N = INPUT[0]
K = INPUT[1]
Q = INPUT[2]
#print(INPUT)
A = []
for i in range(Q):
        A.append(int(input()))
#print(A)

P = [K]*N
#print(P)
for a in A:
    for i in range(len(P)):
        P[i] = P[i] - 1
    P[a-1] = P[a-1] + 1

#print(P)

for i in P:
    if(i >= 1):
        print("Yes")
    else:
        print("No")
    

Fixed submission:
INPUT = [int(i) for i in input().split(" ")]

N = INPUT[0]
K = INPUT[1]
Q = INPUT[2]
#print(INPUT)
A = []
for i in range(Q):
        A.append(int(input()))
#print(A)

P = [K]*N
#print(P)
for i in range(len(P)):
    P[i] = P[i] - Q

for i in A:
    P[i-1] = P[i-1] + 1
    

#print(P)

for i in P:
    if(i >= 1):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):

N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[-1]
A = [min(B[i],B[i+1] for i in range(N-2)]
C = sum(k + A)
print(C)


Fixed submission:
N=int(input())
n= N*N*N
print(n)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = sum(B)
for t in range(N-1):
    if a[t] + 1 == a[t + 1]:
        m += C[a[t] - 1]
print(m)
         

Fixed submission:
N=int(input())
n= N*N*N
print(n)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m += B[a[i] - 1]
for t in range(N-1):
    if a[t] + 1 == a[t + 1]:
        m += C[a[t] - 1]
print(m)
         

Fixed submission:
N=int(input())
n= N*N*N
print(n)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m=0
for i in range(N):
    m +=B[a[i] -1]
for i in range(N-1):
    if a[i] + 1 == a[i + 1]:
        m +=C[a[i] - 1]
print(m)
         
    

Fixed submission:
N=int(input())
n= N*N*N
print(n)

Buggy python submission (verdict: Runtime Error):
N=input()
n=N*N*N
print(n)

Fixed submission:
N=int(input())
n= N*N*N
print(n)

Buggy python submission (verdict: Runtime Error):
N=int(input())
n=N*N*N
print(n

Fixed submission:
N=int(input())
n= N*N*N
print(n)

Buggy python submission (verdict: Runtime Error):
n=int(input('N'))
if n<10 or n>0:
    combination=n*n*n
    print(combination)
else:
    break

Fixed submission:
N=int(input())
n= N*N*N
print(n)
Buggy python submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))
k = [B[0]+B[-1]]
A = [ min(B[i],B[i+1] for i in range (N-2) ]
C = sum(k + A)
print(C)


Fixed submission:
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[N-2]
for i in range(1, N-1):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)

Buggy python submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[-1]
A = [ min(B[i],B[i+1] for i in range (N-2) ]
C = sum(k + A)
print(C)


Fixed submission:
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[N-2]
for i in range(1, N-1):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)

Buggy python submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))
k = B[0]
for i in range(1, N):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)


Fixed submission:
N = int(input())
B = list(map(int, input().split()))
k = B[0]+B[N-2]
for i in range(1, N-1):
    if B[i] < B[i-1]:
        k += B[i]
    else:
        k += B[i-1]
print(k)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
k = 1
s=0
while k < B:
    k += A - 1
    s += 1
print(s)

Fixed submission:
S=input()
T=input()
x=0
for i in range(3):
    if S[i]==T[i]:
        x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
e=input(”S"）
r=input(”T")
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

Fixed submission:
S=input()
T=input()
x=0
for i in range(3):
    if S[i]==T[i]:
        x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
e=input(S)
r=input(T)
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

Fixed submission:
S=input()
T=input()
x=0
for i in range(3):
    if S[i]==T[i]:
        x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
e=input(S)
r=input(T)
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

Fixed submission:
S=input()
T=input()
x=0
for i in range(3):
    if S[i]==T[i]:
        x += 1
print(x)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
res = 0
temp = 0
for i in range(N):
    if temp > res:
        res = temp
    if H[i] >= H[i+1]:
        temp += 1
    else :
        temp = 0
print(res)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
k = 0
m = 0
for i in range(N):
    if k < m:
        k = m
    if i != N - 1 and H[i] >= H[i+1]:
        m += 1
    else:
        m =0
print(k)

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
k = 0
while H[i] >= H[i+1] for i in range(N):
    k += 1
print(k)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
k = 0
m = 0
for i in range(N):
    if k < m:
        k = m
    if i != N - 1 and H[i] >= H[i+1]:
        m += 1
    else:
        m =0
print(k)

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
k = 0
m = 0
for i in range(N-1):
    while H[i] >= H[i+1]:
        i += 1
        m += 1
    if k < m:
        k = m
    m = 0
print(k)


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
k = 0
m = 0
for i in range(N):
    if k < m:
        k = m
    if i != N - 1 and H[i] >= H[i+1]:
        m += 1
    else:
        m =0
print(k)
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=int(input())
if a >= 3200:
    print(s)
else:
    print('red')

Fixed submission:
a=int(input())
s=input()
if a >= 3200:
    print(s)
else:
    print('red')
Buggy python submission (verdict: Runtime Error):
K, X = map(int, input().split())
list =[]
for i in range(X - K + 1, X + K):
    x.append(i)
print(list)

Fixed submission:
K, X = map(int, input().split())
for i in range(X - K + 1, X + K):
    print(i, end = ' ')
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [sorted(input()) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        sum +=s_dict[s[i]]
        s_dict[s[i]] += 1
    else:
        s_dict[s[i]] = 1
print(sum)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        sum +=s_dict(s[i])
        s_dict(s[i]) += 1
    else:
        s_dict(s[i]) = 1
print(sum)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        s_dict(s[i]) += 1
        sum += s_dict(s[i])
    else:
        s_dict(s[i]) = 1
print(sum)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [sorted(input()) for _ in range(N)]
s_dict = {}
sum = 0
for i in range(N):
    if s[i] in s_dict.keys():
        s_dict(s[i]) += 1
        sum +=s_dict(s[i])
    else:
        s_dict(s[i]) = 1
print(sum)

Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range()]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)


Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
k = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        if s[i] == s[k] :
            k += 1
print(k)


Fixed submission:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i =< 9:
        k += 1
    elif 100 =< i =< 999:
        k += 1
    elif 10000 =< i =< 99999:
        k += 1
print(k)


Fixed submission:
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)

Buggy python submission (verdict: Runtime Error):
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i < 10:
        k += 1
    elif 100 =< i < 1000:
        k += 1
    elif 10000 =< i < 100000:
        k += 1
print(k)

Fixed submission:
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)

Buggy python submission (verdict: Runtime Error):
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i < 10:
        k += 1
    if 100 =< i < 1000:
        k += 1
    if 10000 =< i < 100000:
        k += 1
print(k)


Fixed submission:
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)

Buggy python submission (verdict: Runtime Error):
N =int(input())
k = 0
for i in range(1, N+1):
    if 1 =< i <10:
        k += 1
    if 100 =< i <1000:
        k += 1
    if 10000 =< i <100000:
        k += 1
print(k)

Fixed submission:
N = int(input())
k = 0
for i in range(1, N+1):
    if 1 <= i <= 9:
        k += 1
    elif 100 <= i <= 999:
        k += 1
    elif 10000 <= i <= 99999:
        k += 1
print(k)
Buggy python submission (verdict: Runtime Error):
import math
N, D = map(int, input().split())
print(math.ceil(N/(2D+1)))


Fixed submission:
import math
N, D = map(int, input().split())
print(math.ceil(N /(2 * D + 1)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
A_sort = sorted(A)
for i in range(N) :
    if a[i] == a[-1] :
        print(a[-2])
    else :
        print(a[-1])

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
A_sort = sorted(A)
for i in range(N) :
    if A[i] == A_sort[-1] :
        print(A_sort[-2])
    else :
        print(A_sort[-1])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]
for i in range(N) :
    k = A[i]
    del A[i]
    print(max(A))
    A.insert(i, k)


Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
A_sort = sorted(A)
for i in range(N) :
    if A[i] == A_sort[-1] :
        print(A_sort[-2])
    else :
        print(A_sort[-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [map(int, input()split()) for _ in range(N)]
for i in range(N) :
    k = A[i]
    del A[i]
    print(max(A))
    A.insert(i, k)


Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
A_sort = sorted(A)
for i in range(N) :
    if A[i] == A_sort[-1] :
        print(A_sort[-2])
    else :
        print(A_sort[-1])
Buggy python submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Fixed submission:
N, D = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l' += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)


Fixed submission:
N, D = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        length' = 0.0
        for d in range(D) :
            length' += (x[i][d] - x[j][d]) ** 2
        length = length' ** (1/2)
        if length.is_integer() :
            s += 1
print(s)


Fixed submission:
N, D = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)

Buggy python submission (verdict: Runtime Error):
N, D = int(input())
x = [list(map(int, input().split())) for _ in range(N)]
# for _ in range でリストを何行にもわたって書ける
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        length' = 0.0
        for d in range(D) :
            length' += (x[i][d] - x[j][d]) ** 2
        length = length' ** (1/2)
        if length.is_integer() :
        # 整数かどうか判定
            s += 1
print(s)


Fixed submission:
N, D = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
s = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        l = 0.0
        for d in range(D) :
            l += (x[i][d] - x[j][d]) ** 2
        length = l ** (1/2)
        if length.is_integer() :
            s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N/2] - d_sort[N/2 - 1])


Fixed submission:
N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N//2] - d_sort[N//2 - 1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N/2] - d_sort[N/2-1])


Fixed submission:
N = int(input())
d = list(map(int, input().split()))
d_sort = sorted(d)
print(d_sort[N//2] - d_sort[N//2 - 1])
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D = map(int, input().split())
num = 0
for i in range(A, B+1):
    if i % C == 0:
        num += 1
    elif i % D == 0:
        num += 1
x_num = B - A + 1 - num
print(x_num)


Fixed submission:
A, B, C, D = map(int, input().split())
def gcd(a, b):
    if a < b:
        a, b = b, a
    a, b = b, a % b
    if b == 0 :
        return a
    else:
        return gcd(a, b)
cd = C * D //gcd(C, D)
print(B - B // C - B // D + B // cd - A + 1 + (A - 1) // C + (A - 1)// D - (A - 1)// cd)

Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
num = 0
for i in range(A, B+1):
    if i % C = 0:
        num += 1
    elif i % D = 0:
        num += 1
x_num = B - A + 1 - num
print(x_num)


Fixed submission:
A, B, C, D = map(int, input().split())
def gcd(a, b):
    if a < b:
        a, b = b, a
    a, b = b, a % b
    if b == 0 :
        return a
    else:
        return gcd(a, b)
cd = C * D //gcd(C, D)
print(B - B // C - B // D + B // cd - A + 1 + (A - 1) // C + (A - 1)// D - (A - 1)// cd)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D = map(int, input().split())
num = 0
for i in range(A, B+1):
    if i % C != 0 and i % D != 0:
        num += 1
print(num)


Fixed submission:
A, B, C, D = map(int, input().split())
def gcd(a, b):
    if a < b:
        a, b = b, a
    a, b = b, a % b
    if b == 0 :
        return a
    else:
        return gcd(a, b)
cd = C * D //gcd(C, D)
print(B - B // C - B // D + B // cd - A + 1 + (A - 1) // C + (A - 1)// D - (A - 1)// cd)
Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
if W % 2 == 0 and H % 2 == 0 and x, y = W/2, H/2 :
    print(str(W*H/2)+ ' ' + str(1))
else:
    print(str(w*H/2)+ ' ' + str(0))


Fixed submission:
W, H, x, y = map(int, input().split())
if W/2 == x and H/2 == y:
    print(str(W*H/2)+ ' ' +str(1))
else:
    print(str(W*H/2)+ ' ' +str(0))

Buggy python submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
if W % 2 == 0 and H % 2 == 0 and x, y = W/2, H/2 :
    print(W * H /2, 1)
else:
    print(W * H /2, 0)


Fixed submission:
W, H, x, y = map(int, input().split())
if W/2 == x and H/2 == y:
    print(str(W*H/2)+ ' ' +str(1))
else:
    print(str(W*H/2)+ ' ' +str(0))