Buggy python submission (verdict: Runtime Error):
def dfs(coord, visited, route, sum):
    n = len(visited)
  
    allVisited = True
    for city in range(n):
        if visited[city] is False:
            allVisited = False
            break
      
    if allVisited is True:
        len = 0
        for i in range(1, n):
            len += (
              (coord[i-1][0] - coord[i][0])**2
              +
              (coord[i-1][1] - coord[i][1])**2
            )**0.5
        sum += len
        return sum
  
    for next_city in range(n):
        if visted[next_city] is False:
            visted[next_city] = True
            route.append(next_city)
            sum = dfs(coord, visited, route, sum)
            visted[next_city] = False
            route.pop(-1)
           
    return sum
                    
n = int(input())
coord = []
route = []
visited = [False]*n
                    
for i in range(n):
    x, y = map(int, input().split())
    coord.append([x, y])
           

sum = 0
sum = dfs(coord, visited, route, sum)
                    
perm = 1
for i in range(1, n+1):
    perm*=i

print(sum/perm)

Fixed submission:
def dfs(coord, visited, route, sum):
    n = len(visited)

    allVisited = True
    for city in range(n):
        if visited[city] is False:
            allVisited = False
            break

    if allVisited is True:
        dist = 0

        for i in range(1, len(route)):
            prev = route[i - 1]
            cur = route[i]
            dist += (
                (coord[prev][0] - coord[cur][0]) ** 2
                + (coord[prev][1] - coord[cur][1]) ** 2
            ) ** 0.5
        sum += dist
        return sum

    for next_city in range(n):
        if visited[next_city] is False:
            visited[next_city] = True
            route.append(next_city)
            sum = dfs(coord, visited, route, sum)
            visited[next_city] = False
            route.pop(-1)

    return sum


n = int(input())
coord = []
route = []
visited = [False] * n

for i in range(n):
    x, y = map(int, input().split())
    coord.append([x, y])


sum = 0
sum = dfs(coord, visited, route, sum)

perm = 1
for i in range(1, n + 1):
    perm *= i

print(sum / perm)

Buggy python submission (verdict: Runtime Error):
def dis(x1, y1, x2, y2):
  d = math.sqrt((x2-x1)**2 + (y2-y1)**2)
  return d

def dfs(visited, x, y, prev, dis, total_dis):
  n = len(x) 
  allCityVisited = True
  for i in range(n):
    if visited[i] is False:
      allCityVisited = False
  if allCityVisited:
    total_dis += dis
    return total_dis
    
  for i in range(n):
    if visited[i] is False:
      dis += dis(x[i], y[i], x[prev], y[prev])
      visited[i] = True
      org_prev = prev
      prev = i
      dfs(visited, x, y, prev, dis, total_dis)
      visited[i] = False
      prev = org_prev
      
  return total_dis

n = int(input())
x = [0]*n
y = [0]*n

for i in range(n):
  x[i], y[i] = map(int, input().split())
  
visited = [False]*n
total_dis = 0

for i in range(n):
  visited[i] = True
  total_dis += dfs(visited, x, y, i, 0, totala_dis)
  visited[i] = False
  
prem = 1
for i in range(n):
  perm*=n
  
print(total_dis/perm)


Fixed submission:
def dfs(coord, visited, route, sum):
    n = len(visited)

    allVisited = True
    for city in range(n):
        if visited[city] is False:
            allVisited = False
            break

    if allVisited is True:
        dist = 0

        for i in range(1, len(route)):
            prev = route[i - 1]
            cur = route[i]
            dist += (
                (coord[prev][0] - coord[cur][0]) ** 2
                + (coord[prev][1] - coord[cur][1]) ** 2
            ) ** 0.5
        sum += dist
        return sum

    for next_city in range(n):
        if visited[next_city] is False:
            visited[next_city] = True
            route.append(next_city)
            sum = dfs(coord, visited, route, sum)
            visited[next_city] = False
            route.pop(-1)

    return sum


n = int(input())
coord = []
route = []
visited = [False] * n

for i in range(n):
    x, y = map(int, input().split())
    coord.append([x, y])


sum = 0
sum = dfs(coord, visited, route, sum)

perm = 1
for i in range(1, n + 1):
    perm *= i

print(sum / perm)