Buggy python submission (verdict: Runtime Error):
import numpy as np
def factorial(n):
  if (n==1):
    return 1
  return n*factorial(n-1)

n = int(input())
x = []
y = []
for i in range(n):
  x_, y_ = list(map(int, input().split()))
  x.append(x_)
  y.append(y_)
val = 0
for i in range(n):
  for j in range(i+1, n):
    val += np.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

ans = val/factorial(n) * factorial(n-1) * 2
print(ans)

Fixed submission:
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
 
from itertools import permutations
from math import sqrt
 
paths = list(permutations(range(N), N))
l = len(paths)
total = 0
for path in paths:
    tmp = 0
    x, y = xy[path[0]][0], xy[path[0]][1]
    for p in path[1:]:
        px, py = xy[p][0], xy[p][1]
        tmp += sqrt((px-x)**2 + (py-y)**2)
    total += tmp
print(total / l)

Buggy python submission (verdict: Runtime Error):
import numpy as np
from math import factorial
n = int(input())
x = []
y = []
for i in range(n):
  x_, y_ = list(map(int, input().split()))
  x.append(x_)
  y.append(y_)
val = 0
for i in range(n):
  for j in range(i+1, n):
    val += np.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

ans = val/factorial(n) * factorial(n-1) * 2
print(ans)

Fixed submission:
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
 
from itertools import permutations
from math import sqrt
 
paths = list(permutations(range(N), N))
l = len(paths)
total = 0
for path in paths:
    tmp = 0
    x, y = xy[path[0]][0], xy[path[0]][1]
    for p in path[1:]:
        px, py = xy[p][0], xy[p][1]
        tmp += sqrt((px-x)**2 + (py-y)**2)
    total += tmp
print(total / l)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
x = []
y = []
for i in range(n):
  x_, y_ = list(map(int, input().split()))
  x.append(x_)
  y.append(y_)
val = 0
for i in range(n):
  for j in range(i+1, n):
    val += np.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

ans = val/math.factorial(n) * math.factorial(n-1) * 2
print(ans)

Fixed submission:
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
 
from itertools import permutations
from math import sqrt
 
paths = list(permutations(range(N), N))
l = len(paths)
total = 0
for path in paths:
    tmp = 0
    x, y = xy[path[0]][0], xy[path[0]][1]
    for p in path[1:]:
        px, py = xy[p][0], xy[p][1]
        tmp += sqrt((px-x)**2 + (py-y)**2)
    total += tmp
print(total / l)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
x = []
y = []
for i in range(n):
  x_, y_ = list(map(int, input().split()))
  x.append(x_)
  y.append(y_)
val = 0
for i in range(n):
  for j in range(i+1, n):
    val += np.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

ans = val/math.factorial(n) * math.factorial(n-1) * 2
print(ans)

Fixed submission:
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
 
from itertools import permutations
from math import sqrt
 
paths = list(permutations(range(N), N))
l = len(paths)
total = 0
for path in paths:
    tmp = 0
    x, y = xy[path[0]][0], xy[path[0]][1]
    for p in path[1:]:
        px, py = xy[p][0], xy[p][1]
        tmp += sqrt((px-x)**2 + (py-y)**2)
    total += tmp
print(total / l)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
n = int(input())
x = []
y = []
for i in range(n):
  x_, y_ = list(map(int, input().split()))
  x.append(x_)
  y.append(y_)
val = 0
for i in range(n):
  for j in range(i+1, n):
    val += np.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

ans = val/math.factorial(n) * math.factorial(n-1) * 2
print(ans)

Fixed submission:
N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
 
from itertools import permutations
from math import sqrt
 
paths = list(permutations(range(N), N))
l = len(paths)
total = 0
for path in paths:
    tmp = 0
    x, y = xy[path[0]][0], xy[path[0]][1]
    for p in path[1:]:
        px, py = xy[p][0], xy[p][1]
        tmp += sqrt((px-x)**2 + (py-y)**2)
    total += tmp
print(total / l)