Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02696 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
import math
A, B, N = map(int, input().split())

def f(x):
    return math.floor(A*x/B) - A * math.floor(x/B)

def main():
    print(f(min(N, B-1)))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
def main():
    N, M, Q = map(int, input().split())
    r_list = []
    for i in range(Q):
        r_list.append(list(map(int, input().split())))
    max_score = 0
    a1 = 1
    for a2 in range(a1, M+1):
        for a3 in range(a2, M+1):
            for a4 in range(a3, M+1):
                for a5 in range(a4, M+1):
                    for a6 in range(a5, M+1):
                        for a7 in range(a6, M+1):
                            for a8 in range(a7, M+1):
                                for a9 in range(a8, M+1):
                                    for a10 in range(a9, M+1):
                                        a_list = [a1,a2,a3,a4,a5,a6,a7,a8,a9,a10]
                                        score = 0
                                        for r in r_list:
                                            if a_list[r[1]-1] - a_list[r[0]-1] == r[2]:
                                                score += r[3]
                                        max_score = max(score, max_score)
    print(max_score)

if __name__ == "__main__":
    main()
Problem p02658 (python)

Fixed submission:
import math
n = int(input())
m = 10**18
l = [int(x) for x in input().split()]
l.sort();
prod = 1
for i in l:
	prod *= i
	if prod > m:
		prod = -1
		break
	elif prod == 0:
		break
print(prod)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())

l = [int(x) for x in input().split()]

prod = math.prod(l)
if prod > 10**18:
	print(-1)
else:
	print(prod)
Problem p02584 (python)

Fixed submission:
X, K, D = map(int, input().split())
ans = 0
if X == 0:
    if K % 2 != 0:
        ans = D
elif X > 0:
    a = int(X/D)
    if K > a:
        diff = K - a
        X_temp = X - a * D
        if abs(X_temp - D) < X_temp:
            if (diff - 1) % 2 == 0:
                ans = abs(X_temp - D)
            else:
                ans = X_temp
        else:
            if diff % 2 == 0:
                ans = X_temp
            else:
                ans = abs(X_temp - D)
    else:
        ans = X - K * D
else:
    a = int(abs(X)/D)
    if K > a:
        diff = K - a
        X_temp = X + a * D
        if abs(X_temp + D) < abs(X_temp):
            if (diff - 1) % 2 == 0:
                ans = abs(X_temp + D)
            else:
                ans = abs(X_temp)
        else:
            if diff % 2 == 0:
                ans = abs(X_temp)
            else:
                ans = abs(X_temp + D)
    else:
        ans = abs(X + K * D)
print(ans)

Buggy submission (verdict: Runtime Error):
X, K, D = map(int, input().split())
ans = 0
if X == 0:
    if K % 2 != 0:
        ans = D
elif X > 0:
    a = int(X/D)
    if K > a:
        diff = K - a
        X_temp = X - a * D
        if abs(X_temp - D) < X_temp:
            if (diff - 1) % 2 == 0:
                ans = abs(X_temp - D)
            else:
                ans = X_temp
        else:
            if diff % 2 == 0:
                ans = X_temp
            else:
                ans = abs(X_temp - D)
    else:
        ans = X - K * D
else:
    if K > a:
        diff = K - a
        X_temp = X + a * D
        if abs(X_temp + D) < abs(X_temp):
            if (diff - 1) % 2 == 0:
                ans = abs(X_temp + D)
            else:
                ans = abs(X_temp)
        else:
            if diff % 2 == 0:
                ans = abs(X_temp)
            else:
                ans = abs(X_temp + D)
    else:
        ans = abs(X + K * D)
print(ans)
Problem p02608 (python)

Fixed submission:
import math
N = int(input())
ans = 0
num = {i:0 for i in range(1, N+1)}
upper = int(math.sqrt(N)) + 1
for x in range(1, upper):
    for y  in range(1, upper):
        z = 1
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > N:
            break
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v in num.keys():
                num[v] += 1
            if v > N:
                break
for n in range(1, N+1):
    print(num[n])

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
ans = 0
num = {i:0 for i in range(1, N+1)}
upper = int(math.sqrt(N)) + 1
for x in range(1, upper):
    for y  in range(1, upper):
        z = 1
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > n:
            break
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v in num.keys():
                num[v] += 1
            if v > N:
                break
for n in range(1, N+1):
    print(num[n])
Problem p02646 (python)

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
diff_dist = B - A
diff_v = V - W
flag = False
if diff_v == 0:
    if diff_dist == 0:
        flag = True
elif diff_dist == 0:
    flag = True
else:
    if diff_v > 0:
        t = abs(diff_dist) / diff_v
        if t <= T:
            flag = True
if flag:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
diff_dist = B - A
diff_v = V - W
flag = False
if diff_dist == 0:
    flag = True
else:
    if diff_dist > 0:
        if diff_v > 0:
            t = diff_dist / diff_v
            if t <= T:
                flag = True
        else:
            flag = False
    else:
        if diff_v < 0:
            t = diff_dist / diff_v
            if t <= T:
                flag = True
        else:
            flag = Flase
if flag:
    print('YES')
else:
    print('NO')
Problem p02702 (python)

Fixed submission:
S = input()
N = len(S)
mod = 2019
num = [0 for i in range(2019)]
num[0] = 1
t = 1
rem = 0

for i in reversed(S):
    rem += int(i) * t
    rem %= mod
    t *= 10
    t %= mod
    num[rem] += 1

print(int(sum([i * (i-1) / 2 for i in num])))

Buggy submission (verdict: Runtime Error):
import numpy as np
S = input()
S_list = []
for i in range(len(S)):
    S_list.append(int(S[i]))
S_list = np.array(S_list)
num = 0
for i in range(len(S_list)-3):
    sum_temp = np.sum([v * np.power(10, k) for k, v in enumerate(S_list[i:i+3][::-1])])
    #print(i, i+3, sum_temp)
    k = 0
    for j in range(i+3, len(S)):
        #print(S_list[j])
        sum_temp *= 10
        sum_temp += S_list[j]
        if sum_temp % 2019 == 0:
            num += 1
print(num)
Problem p02843 (python)

Fixed submission:
X = int(input())
dp = [False for _ in range(X+1)]
dp[0] = True
for x in range(X+1):
    if x > 99:
        item = [100, 101, 102, 103, 104, 105]
        for i in item:
            if dp[x-i]:
                dp[x] = True
if dp[X]:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
s = time.time()
X = int(input())
if X < 100:
    print(0)
else:
    item = [100, 101, 102, 103, 104, 105]
    dp = [[False for _ in range(X//100+10)] for _ in range(X+10)]
    dp[0][0] = True
    dp[100][1] = True
    dp[101][1] = True
    dp[103][1] = True
    dp[102][1] = True
    dp[105][1] = True
    for x in range(200, X+1):
        for n in range(2, x//100+1):
            for i in item:
                if dp[x-i][n-1]:
                    dp[x][n] = True
                    if x == X:
                        break
    if True in dp[X]:
        print(1)
    else:
        print(0)
f = time.time()
print(f-s)

Buggy submission (verdict: Runtime Error):
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+4)] for _ in range(X+1)]
dp[0][0] = True
dp[100][1] = True
dp[101][1] = True
dp[102][1] = True
dp[105][1] = True
for x in range(100, X+1):
    for n in range(1, X//100+4):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+4)] for _ in range(X+2)]
dp[0][0] = True
for x in range(X+2):
    for n in range(X//100+4):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+3)] for _ in range(X+1)]
dp[0][0] = True
for x in range(X+1):
    for n in range(X//100+3):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)
Problem p02844 (python)

Fixed submission:
N = int(input())
S = input()
ans = 0
for i in range(1000):
    v = str(i).zfill(3)
    idx = 0
    c = 0
    idx_now = 0
    for j in range(3):
        idx = S[idx_now:].find(v[j])
        if idx == -1:
            break
        else:
            idx_now += idx + 1
            c += 1
    if c == 3:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [s for s in input()]
ans = 0
for i in range(1000):
    v = str(i).zfill(3)
    idx = 0
    for j, s in enumerate(S):
        if v[idx] == s:
            idx += 1
            if v[idx] not in S[j+1:]:
                break
        if idx == 3:
            ans += 1
            break
print(ans)
Problem p02845 (python)

Fixed submission:
N = int(input())
A = map(int, input().split())
num = {i:0 for i in range(N+1)}
num[0] = 3
ans = 1
MOD = 1000000007
for a in A:
    ans *= num[a] % MOD
    num[a] -= 1
    num[a+1] += 1
print(ans%MOD)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
num = {i:0 for i in range(N+1)}
ans = 1
mod = 1000000007
for a in A:
    s += str(a)
    if a == 0:
        if a not in num.keys():
            num[a] = 1
            ans *= 3 %mod
        else:
            if 1 not in num.keys():
                ans *= (3 - num[a]) %mod
            num[a] += 1
    else:
        if a not in num.keys():
            num[a] = 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
        else:
            num[a] += 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
    #print(s, num, ans%mod)
print(ans%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
num = {}
ans = 1
mod = 1000000007
for a in A:
    s += str(a)
    if a == 0:
        if a not in num.keys():
            num[a] = 1
            ans *= 3 %mod
        else:
            if 1 not in num.keys():
                ans *= (3 - num[a]) %mod
            num[a] += 1
    else:
        if a not in num.keys():
            num[a] = 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
        else:
            num[a] += 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
    #print(s, num, ans%mod)
print(ans%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int ,input().split()))
num = {}
ans = 1
mod = 1000000007
s = ''
for a in A:
    s += str(a)
    if a == 0:
        if a not in num.keys():
            num[a] = 1
            ans *= 3 %mod
        else:
            if 1 not in num.keys():
                ans *= (3 - num[a]) %mod
            num[a] += 1
    else:
        if a not in num.keys():
            num[a] = 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
        else:
            num[a] += 1
            ans *= num[a-1] %mod
            num[a-1] -= 1
    #print(s, num, ans%mod)
print(ans%mod)
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L_max = max(L)
if sum(L) > 2*L_max:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input()))
L_max = max(L)
if sum(L) > 2*L_max:
  print('Yes')
else:
  print('No')
Problem p03161 (python)

Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
INF = 10**9
dp = [INF] * N
dp[0] = 0
for i in range(N):
    for k in range(1, K+1):
        if i + k < N:
            dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
def main():
	N, K = map(int, input().split())
	h = list(map(int, input().split()))
	INF = 10**9
	dp = [INF] * N
	dp[0] = 0
	for i in range(N):
    	for k in range(1, K+1):
        	if i + k < N:
            	dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
        	else:
            	break
	print(dp[N-1])

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
def main():
	N, K = map(int, input().split())
	h = list(map(int, input().split()))
	INF = 10**9
	dp = [INF] * N
	dp[0] = 0
	for i in range(N):
    	for k in range(1, K+1):
        	if i + k < N:
            	dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
        	else:
            	break
	print(dp[N-1])

if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  N, K = map(int, input().split())
	h = list(map(int, input().split()))
	INF = 10**9
	dp = [INF] * N
	dp[0] = 0
	for i in range(N):
    	for k in range(1, K+1):
        	if i + k < N:
            	dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
        	else:
            	break
	print(dp[N-1])

if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
INF = 10**9
h = [INF] * (2*N)
h[:N] = list(map(int, input().split()))
dp = [INF] * (2*N)
dp[0] = 0
for i in range(N):
    for k in range(1, K+1):
        dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [0] * (2*N)
h[:N] = list(map(int, input().split()))
INF = 10**9
dp = [INF] * (2*N)
dp[0] = 0
for i in range(N):
    for k in range(1, K+1):
        dp[i+k] = min(dp[i+k], dp[i]+abs(h[i] - h[i+k]))
print(dp[N-1])
Problem p03164 (python)

Fixed submission:
N, W = map(int, input().split())
wv = []
for _ in range(N):
    wv.append(list(map(int, input().split())))
INF = 10**10
v_max = 10**5
dp = [[INF]*(v_max+1) for _ in range(N+1)]
dp[0][0] = 0
ans = 0
for i in range(N):
    for j in range(v_max+1):
        if j >= wv[i][1]:
            dp[i+1][j] = min(dp[i][j], dp[i][j-wv[i][1]]+wv[i][0])
            #print(i, j, dp[i+1][j], dp[i][j], wv[i][0])
        else:
            dp[i+1][j] = dp[i][j]
        if i+1 == N and dp[i+1][j] <= W:
            ans = j
print(ans)

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
WV = []
for _ in range(N):
    WV.append(list(map(int, input().split())))
V = [v for w, v in WV]
INF = 10**10
v_max = sum(V)
dp = [[INF]*(v_max+1) for _ in range(N+1)]
dp[0][0] = 0.0
ans = 0
for i in range(N):
    for j in range(v_max+1):
        if j >= wv[i][1]:
            dp[i+1][j] = min(dp[i][j], dp[i][j-wv[i][1]]+wv[i][0])
            #print(i, j, dp[i+1][j], dp[i][j], wv[i][0])
        else:
            dp[i+1][j] = dp[i][j]
        if i+1 == N and dp[i+1][j] <= W:
            ans = j
print(int(ans))
Problem p03059 (python)

Fixed submission:
a,b,t = map(int,input().split())
count=1
sum=0
while a*count < t+0.5:
    sum=sum + b
    count+=1
print(sum)

Buggy submission (verdict: Runtime Error):
import sys
import os
import math
import fractions
from functools import reduce
from fractions import gcd

def test(x,k,m):
    #print("i=",k)
    tmp=[0]*len(x)
    for j in range(m):
        tmp[j]=x[j]
    #print('a=',x)
    #print('tmp=',tmp)
    del tmp[k]
    #print('tmp=',tmp)
    #print("a==",x)
    XX=gcd(*tmp)
    #print("XX=",XX)
    return XX

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
a= list(map(int,input().split()))

yakusu=[0]*len(a)
for i in range(n):
    yakusu[i]=test(a,i,n)

ans=max(yakusu)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import os
import math
from functools import reduce
from fractions import gcd

def test(x,k,m):
    #print("i=",k)
    tmp=[0]*len(x)
    for j in range(m):
        tmp[j]=x[j]
    #print('a=',x)
    #print('tmp=',tmp)
    del tmp[k]
    #print('tmp=',tmp)
    #print("a==",x)
    XX=gcd(*tmp)
    #print("XX=",XX)
    return XX

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
a= list(map(int,input().split()))

yakusu=[0]*len(a)
for i in range(n):
    yakusu[i]=test(a,i,n)

ans=max(yakusu)
print(ans)
Problem p02922 (python)

Fixed submission:
if __name__ =='__main__':
    a, b = list(map(int,input().split()))
    if b == 1:
        print(0)
    else :
        c = 1
        d = a
        while True:
            if d >= b:
                print(c)
                break
            else :
                d += a-1
                c+=1

Buggy submission (verdict: Runtime Error):
if __name__ =='__main__':
    a, b = list(map(int,input().split()))
    if b = 1:
        print(0)
    else :
        c = 1
        d = a
        while True:
            if d >= b:
                print(c)
                break
            else :
                d += a-1
                c+=1
Problem p02717 (python)

Fixed submission:

a, b, c = map(int, input().split())
print(c,a,b)

Buggy submission (verdict: Runtime Error):
import sys
import math

n, k = map(int, input().split())

pre=n-math.floor(n/k)*k

while 1:
    if pre <= abs(pre-k):
        print(pre)
        sys.exit()
    pre = abs(pre - k)
Problem p02742 (python)

Fixed submission:
h,w=map(int,input().split())

if((h==1)or(w==1)):
    print(1)
elif (h*w)%2==0:
    print(int(h*w/2))
else:
    print(int((h*w+1)/2))

Buggy submission (verdict: Runtime Error):

if(h==1)or (w==1):
    print(1)
elif (h*w)%2==0:
    print(int(h*w/2))
else:
    print(int((h*w+1)/2))

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
long long h;
long long w;

cin >> h >> w;


if((h*w)%2==0){
    cout<<h*w/2<<endl;
}
else{
    cout<<(h*w+1)/2<<endl;
}
  
}
Problem p03000 (python)

Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))

sum = 0
ans = 0

for i in range(n):
    if sum + l[ans] > x:
        break
    sum += l[ans]
    ans += 1

print(ans+1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

sum = 0
ans = 0

for i in range(n+1):
    if sum + l[ans] > x:
        break
    sum += l[ans]
    ans += 1

print(ans+1)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

sum = 0
ans = 0

for i in range(n+1):
    if sum + l[ans] > x:
        break
    sum += l[ans]
    ans += 1

print(ans+1)

Buggy submission (verdict: Runtime Error):
n,x=map(int, input().split())
l =list(map(int,input().split()))

sum = 0
ans = 0

while sum < x or ans<n+1:
    sum+=l[ans]
    ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int, input().split())
l =list(map(int,input().split()))

sum = 0
ans = 0

while sum < x or ans<n:
    sum+=l[ans]
    ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
n,x=map(int, input().split())
l =list(map(int,input().split()))

sum = 0
ans = 0

while sum+l[ans] <= x:
    sum+=l[ans]
    ans += 1
    
print(ans+1)

Buggy submission (verdict: Runtime Error):
n,x=map(int, input().split())
l =list(map(int,input().split()))

sum = 0
ans = 0

while sum <= x:
    sum+=l[ans]
    ans += 1
    
print(ans)
Problem p03740 (python)

Fixed submission:
a,b=[int(x) for x in input().split()]
if abs(a-b)<=1:
  	print("Brown")
else:
  	print("Alice")

Buggy submission (verdict: Runtime Error):
a,b=[int(x) for x in input().split()]
if abs(a-b)<=1:
  	print("Brown"):
else:
  	print("Alice")

Buggy submission (verdict: Runtime Error):
a,b=[int(x) for x in input().split()]
if abs(a-b)<=1:
  	print("Brown):
else:
    print("Alice")
Problem p02843 (python)

Fixed submission:
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
        need +=0
    elif ones <= 5:
        need += 1
    else:
        need +=2
    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = str(input())
if len(n) <= 2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones == 0:
    elif ones <= 5:
        need += 1
    else:
        need +=2

    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = str(input())
if len(n) < =2:
    print(0)
else:
    a = n[0:-2]
    tens = int(n[-2])
    need = tens*2
    ones = int(n[-1])
    if ones < 5:
        need += 1
    else:
        need +=2

    if need <= int(a):
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
n = str(input())
a = n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = str(input())
a =n[0:-2]
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = str(input())
a =int(n[0:-3])
tens = int(n[-2])
need = tens*2
ones = int(n[-1])
if ones < 5:
    need += 1
else:
    need +=2

if need <= int(a):
    print(1)
else:
    print(0)
Problem p02861 (python)

Fixed submission:
import numpy as np
n= int(input())
m = np.zeros((n,2))
sum1 = 0
count =0
for i in range(n):
    m[i] = list(map(int,input().split()))
for j in range(n):
    for k in range(j+1,n):
        sum1 = sum1 + ((m[j][0] - m[k][0])**2 + (m[j][1]-m[k][1])**2)**(1/2)
        count +=1

ans = 0

mul =1
for l in range(n):
    mul *= n-l
po =0
if n ==2:
    po = 1
elif n ==3:
    po =2
else:
    for m in range(n):
        po += m

ans = sum1*(n-1)/count
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n= int(input())
m = np.zeros((3,2))
sum1 = 0
for i in range(n):
    m[i] = list(map(int,input().split()))
for j in range(n-1):
    for k in range(j+1,n):
        sum1 = sum1 + ((m[j][0] - m[k][0])**2 + (m[j][1]-m[k][1])**2)**(1/2)


ans = 0
mul =1
for l in range(n):
    mul *= n-l
ans = (sum1*(2**(n-1)))/mul
print(ans)