Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = str(input())

if n%9 == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
 
if n%9 == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n = str(input())

totL = 0
for i in n:
  total += int(i)
if total % 9 == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
 
if n%9 == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x[-1] == 3:
  print('bon')
elif x[-1] == 0 or x[-1] == 1 or x[-1] == 6 or x[-1] == 8:
  print('pon')
else:
  print('hon')

Fixed submission:
x = str(input())

if x[-1] == '3':
    print('bon')
elif x[-1] == '0' or x[-1] == '1' or x[-1] == '6' or x[-1] == '8':
    print('pon')
else:
    print('hon')
Buggy python submission (verdict: Runtime Error):
r = int(intput())
print(3 * r * r)

Fixed submission:
r = int(input())
print(3 * r * r)
Buggy python submission (verdict: Runtime Error):
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    break
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    sys.exit()
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
s = s.replace(s[0],'')
s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')


Fixed submission:
import sys
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    sys.exit()
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
s = s.replace(s[0],'')
s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')


Fixed submission:
import sys
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    sys.exit()
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
s = s.replace(s[0],'')
s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
   print('No')


Fixed submission:
import sys
s = input()
s = s.replace(s[0],'')
if len(s) == 0:
    print('No')
    sys.exit()
else:
    s = s.replace(s[0],'')
if len(s) == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
li = list()
li2 = list()
for _ in range(5):
    tmp = int(input())
    if(tmp % 10 == 0):
        li2.append(tmp)
    else:
        li.append(tmp)
li.sort(key=lambda x: x % 10, reverse=True)
li2.sort()
ans = sum(li2)
for i in range(len(li)-1):
    ans = ans + ((li[i] // 10 + 1) * 10)
ans += li[-1]
print(ans)


Fixed submission:
li = list()
li2 = list()
for _ in range(5):
    tmp = int(input())
    if(tmp % 10 == 0):
        li2.append(tmp)
    else:
        li.append(tmp)
li.sort(key=lambda x: x % 10, reverse=True)
li2.sort()
ans = sum(li2)
if(len(li)!=0):
    for i in range(len(li)-1):
        ans = ans + ((li[i] // 10 + 1) * 10)
    ans += li[-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
n, t = map(int, input().split())
minCost = 1001
for i range in n:
    cc, tt = map(int, input().split())
    if tt <= t and cc < minCost:
        minCost = cc
if minCost == 1001:
    print('TLE')
else:
    print(minCost)

Fixed submission:
n, t = map(int, input().split())
minCost = 1001
for i in range(n):
    cc, tt = map(int, input().split())
    if tt <= t and cc < minCost:
        minCost = cc
if minCost == 1001:
    print('TLE')
else:
    print(minCost)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input()split())
if abs(a - c) <= d:
	print('Yes')
else:
	if abs(a - b) <= d and abs(c - b) <= d:
		print('Yes')
	else:
		print('No')

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a - c) <= d:
	print('Yes')
else:
	if abs(a - b) <= d and abs(c - b) <= d:
		print('Yes')
	else:
		print('No')
Buggy python submission (verdict: Runtime Error):
1 7 6 4

Fixed submission:
a, b, c, d = map(int, input().split())
if a + b > c + d:
	print('Left')
elif a + b < c + d:
	print('Right')
else:
	print('Balanced')
Buggy python submission (verdict: Runtime Error):
n = list(map(str, input().split()))
if n in '9':
	print('Yes')
else:
	print('No')

Fixed submission:
n = input()
if '9' in n:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
if n in '9':
	print('Yes')
else:
	print('No')

Fixed submission:
n = input()
if '9' in n:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
n = list(input().split())
if n in '9':
	print('Yes')
else:
	print('No')

Fixed submission:
n = input()
if '9' in n:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

m = 10 ** 9 + 7
ans = 1
for i in range(n):
    ans *= i + 1
print(ans % m)


Fixed submission:
import math
n = int(input())

m = 10 ** 9 + 7

print(math.factorial(n) % m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
power = 1
for i in range(1, n + 1):
    power = power * i
print(power % (10 ** 9 + 7))


Fixed submission:
import math
n = int(input())

m = 10 ** 9 + 7

print(math.factorial(n) % m)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
ans = 0
for i in range(a, b+1):
    if (i % x == 0):
        ans += 1
print(ans)


Fixed submission:
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)
Buggy python submission (verdict: Runtime Error):
li = map(int, input().split())
li.sort()
if li[0] + li[1] == li[2]:
	print('Yes')
else:
	print('No')

Fixed submission:
li = list(map(int, input().split()))
li.sort()
if li[0] + li[1] == li[2]:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 標準入力を取得
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

# 求解処理
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)

# 結果出力
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

# 求解処理
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[j] + B[j])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)

# 結果出力
print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 標準入力を取得
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

# 求解処理
ans = 0
n, m, k = 0, 0, 0
while True:
    if n >= N and m >= M:
        break
    if n >= N:
        k += B[m]
        if k > K:
            break
        ans += 1
        m += 1
        continue
    if m >= M:
        k += A[n]
        if k > K:
            break
        ans += 1
        n += 1
        continue
    A_n, B_m = A[n], B[m]
    if A_n < B_m:
        k += A_n
        n += 1
    elif A_n > B_m:
        k += B_m
        m += 1
    else:
        if n == N:
            k += B_m
            m += 1
        elif m == M:
            k += A_n
            n += 1
        else:
            A_nn, B_mm = A[n+1], B[m+1]
            if A_nn <= B_mm:
                k += A_n
                n += 1
            else:
                k += B_m
                m += 1
    if k > K:
        break
    ans += 1

# 結果出力
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N, M, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))

# 求解処理
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[j] + B[j])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)

# 結果出力
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 正整数（1 <= N <= 10^7）
    """
    # 求解処理
    F = [0 for n in range(N + 1)]
    for n in range(1, N + 1):
        for i in range(1, N // n + 1):
            F[n * i] += 1

    ans = sum([n * F[n] for n in range(N + 1)])

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N = get_input()

    # メイン処理
    main(N)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

def g(N: int) -> int:
    return int(N * (N + 1) / 2)

# 求解処理
ans = 0
for n in range(1, N + 1):
    ans += n * g(N // n)
            
# 結果出力
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

# 求解処理
F = [0 for n in range(N + 1)]
for n in range(1, N + 1):
    for i in range(1, N // n + 1):
        F[n * i] += 1
            
ans = sum([n * F[n] for n in range(N + 1)])

# 結果出力
print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

def g(N: int) -> int:
    return int(N * (N + 1) / 2)

# 求解処理
ans = 0
for n in range(1, N + 1):
    ans += n * g(N // n)
            
# 結果出力
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

# 求解処理
F = [0 for n in range(N + 1)]
for n in range(1, N + 1):
    for i in range(1, N + 1):
        if i % n == 0:
            F[i] += 1
            
ans = sum([n * F[n] for n in range(N + 1)])

# 結果出力
print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

def g(N: int) -> int:
    return int(N * (N + 1) / 2)

# 求解処理
ans = 0
for n in range(1, N + 1):
    ans += n * g(N // n)
            
# 結果出力
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from numba import njit, void, i8


def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


@njit(void(i8))
def main(N: int) -> None:
    """
    求解処理.

    Args:\n
        N (int): 整数
    """
    # 求解処理
    ans = ""
    while N > 0:
        N -= 1
        ans += chr(ord("a") + N % 26)
        N //= 26
    ans = ans[::-1]

    # 結果出力
    print(ans)


if __name__ == "__main__":
    N = get_input()
    main(N)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力の取得
N = int(input())


def num_to_alpha(num):
    if num <= 26:
        return chr(96 + num)
    elif num % 26 == 0:
        return num_to_alpha(num // 26 - 1)+chr(122)
    else:
        return num_to_alpha(num // 26) + chr(96 + num % 26)


# 求解処理
ans = num_to_alpha(N)

# 結果出力
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 標準入力の取得
X = int(input())

# 求解処理


def get_B(A: int):
    return - 1 * (X - A ** 5) ** (1 / 5)


def main():
    A = 0
    while True:
        B = get_B(A)
        if (B.imag == 0) and (B.is_integer()):
            break
        A += 1

    result = f"{int(A)} {int(B)}"

    # 結果出力
    print(result)


if __name__ == "__main__":
    main()


Fixed submission:
# -*- coding: utf-8 -*-
# モジュールのインポート
import itertools

# 標準入力の取得
X = int(input())

# 求解処理


def get_value(A: int, B: int) -> int:
    return A**5 - B**5


A_min, A_max = -118, 119
B_min, B_max = -119, 118
result = ""
for A, B in itertools.product(range(A_min, A_max+1), range(B_min, B_max+1)):
    value = get_value(A, B)
    if value == X:
        result = f"{A} {B}"
        break

# 結果出力
print(result)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 標準入力の取得
X = int(input())

# 求解処理
A = 0
while True:
    B = -1*(X-A**5)**(1/5)
    if B.is_integer():
        break
    A += 1

result = f"{int(A)} {int(B)}"

# 結果出力
print(result)


Fixed submission:
# -*- coding: utf-8 -*-
# モジュールのインポート
import itertools

# 標準入力の取得
X = int(input())

# 求解処理


def get_value(A: int, B: int) -> int:
    return A**5 - B**5


A_min, A_max = -118, 119
B_min, B_max = -119, 118
result = ""
for A, B in itertools.product(range(A_min, A_max+1), range(B_min, B_max+1)):
    value = get_value(A, B)
    if value == X:
        result = f"{A} {B}"
        break

# 結果出力
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# モジュールのインポート
import itertools

# 標準入力の取得
N = int(input())
A = list(map(int, input().split()))

# 求解処理
# A_i + i = -A_j + j (i < j)
left = [A[i] + i for i in range(N)]
right = [-A[j] + j for j in range(N)]
result = 0
for i in range(N):
    result += right[i+1:].count(left[i])

# 結果出力
print(result)


Fixed submission:
# -*- coding: utf-8 -*-
# モジュールのインポート
import collections

# 標準入力の取得
N = int(input())
A = list(map(int, input().split()))

# 求解処理
# A_i + i = -A_j + j (i < j)
left = [A[i] + i for i in range(N)]
right = collections.Counter([-A[j] + j for j in range(N)])
result = 0
for l in left:
    result += right[l]

# 結果出力
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding- utf-8 -*-
# C - Sum of gcd of Triplets (Easy)
# モジュールのインポート
import math
import itertools
from functools import reduce

# 標準入力の取得
K = int(input())

# 求解処理
def gcd(*numbers):
    return reduce(math.gcd, numbers)

result = 0
for a,b,c in itertools.product(range(1, K+1), repeat=3):
    result += gcd(a, b, c)

# 結果出力
print(result)

Fixed submission:
# -*- coding- utf-8 -*-
# C - Sum of gcd of Triplets (Easy)
# モジュールのインポート
import math
import itertools
from functools import reduce

# 標準入力の取得
K = int(input())

# 求解処理
result = 0
for a,b in itertools.product(range(1, K+1), repeat=2):
    d = math.gcd(a, b)
    for c in range(1, K+1):
        result += math.gcd(d, c)

# 結果出力
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# D - Line++
# 標準入力の取得
N,X,Y = list(map(int, input().split()))

# 求解
# (i, j)間の最短距離はmin{|j-i|, |X-i|+1+|j-Y|, |Y-i|+1+|j-X|}であるため、
# (i, j)が決まれば、最短距離はO(1)で決まる。したがって、全(i, j)について、最短距離を求める。
k_list = [0 for i in range(1,N)]
for i in range(1, N):
    for j in range(i+1, N+1):
        min_path = min([abs(j-i), abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X)])
        k_list[min_path-1] += 1

# 結果出力
for k in k_list:
    print(k)

Fixed submission:
# -*- coding: utf-8 -*-
# D - Line++
# 標準入力の取得
N,X,Y = list(map(int, input().split()))

# 求解
# (i, j)間の最短距離はmin{|j-i|, |X-i|+1+|j-Y|, |Y-i|+1+|j-X|}であるため、
# (i, j)が決まれば、最短距離はO(1)で決まる。したがって、全(i, j)について、最短距離を求める。
k_list = [0 for i in range(1,N)]
for i in range(1, N):
    diff_X_i = abs(X - i)
    diff_Y_i = abs(Y - i)
    for j in range(i+1, N+1):
        diff_j_i = abs(j - i)
        diff_j_X = abs(j - X)
        diff_j_Y = abs(j - Y)
        min_path = min([diff_j_i, diff_X_i+1+diff_j_Y, diff_Y_i+1+diff_j_X])
        k_list[min_path-1] += 1

# 結果出力
for k in k_list:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# D - Line++
# モジュールのインポート
import itertools

# 標準入力の取得
N,X,Y = list(map(int, input().split()))

# 求解
# (i, j)間の最短距離はmin{|j-i|, |X-i|+1+|j-Y|, |Y-i|+1+|j-X|}であるため、
# (i, j)が決まれば、最短距離はO(1)で決まる。したがって、全(i, j)について、最短距離を求める。
k_list = [0 for i in range(1,N)]
for i,j in itertools.product(range(1,N+1), range(1,N+1)):
    # 1 <= i < j <= Nでなければ、何もしない
    if i >= j:
        continue

    min_path = min([abs(j-i), abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X)])
    k_list[min_path-1] += 1


# 結果出力
for k in k_list:
    print(k)


Fixed submission:
# -*- coding: utf-8 -*-
# D - Line++
# 標準入力の取得
N,X,Y = list(map(int, input().split()))

# 求解
# (i, j)間の最短距離はmin{|j-i|, |X-i|+1+|j-Y|, |Y-i|+1+|j-X|}であるため、
# (i, j)が決まれば、最短距離はO(1)で決まる。したがって、全(i, j)について、最短距離を求める。
k_list = [0 for i in range(1,N)]
for i in range(1, N):
    diff_X_i = abs(X - i)
    diff_Y_i = abs(Y - i)
    for j in range(i+1, N+1):
        diff_j_i = abs(j - i)
        diff_j_X = abs(j - X)
        diff_j_Y = abs(j - Y)
        min_path = min([diff_j_i, diff_X_i+1+diff_j_Y, diff_Y_i+1+diff_j_X])
        k_list[min_path-1] += 1

# 結果出力
for k in k_list:
    print(k)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# モジュールのインポート
from scipy.special import comb

# 標準入力の取得
N, M = list(map(int, input().split()))

# 求解処理
result = comb(N, 2, exact=True) + comb(M, 2, exact=True)

# 結果出力
print(result)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力の取得
N, M = list(map(int, input().split()))

# 求解処理
result = int(N*(N-1)/2 + M*(M-1)/2)

# 結果出力
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    N = int(input())
    S = input()

    return N, S


def main(N: int, S: str) -> None:
    """
    メイン処理

    Args:\n
        N (int): 桁数
        S (str): ラッキーナンバー
    """
    # 求解処理
    ans = 0
    for n in range(1000):
        V = str(n).zfill(3)
        f = 0
        for j in range(N):
            if S[j] == V[f]:
                f += 1
            if f == 3:
                break
        ans += (f == 3)

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N, S = get_input()

    # メイン処理
    main(N, S)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())
S = input()

# 求解処理
ans = 0
x_bit = [False for n in range(10)]
for x in range(N):
    S_x = int(S[x])
    if x_bit[S_x]:
        continue
    x_bit[S_x] = True
    y_bit = [False for n in range(10)]
    for y in range(x + 1, N):
        S_y = int(S[y])
        if y_bit[S_y]:
            continue
        y_bit[S_y] = True
        z_bit = [False for n in range(10)]
        for z in range(y + 1, N):
            S_z = int(S[z])
            if z_bit[S_z]:
                continue
            z_bit[S_z] = True
            ans += 1

# 結果出力
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())
S = input()

# 求解処理
ans = 0
for n in range(1000):
    V = str(n).zfill(3)
    f = 0
    for j in range(N):
        if S[j] == V[f]:
            f += 1
        if f == 3:
            break
    ans += (f == 3)

# 結果出力
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())
S = input()

# 求解処理
ans = 0
x_bit = [False for n in range(10)]
for x in range(N):
    S_x = int(S[x])
    if x_bit[S_x]:
        continue
    x_bit[S_x] = True
    y_bit = [False for n in range(10)]
    for y in range(x + 1, N):
        S_y = int(S[y])
        if y_bit[S_y]:
            continue
        y_bit[S_y] = True
        z_bit = [False for n in range(10)]
        for z in range(y + 1, N):
            S_z = int(S[z])
            if z_bit[S_z]:
                continue
            z_bit[S_z] = True
            ans += 1

# 結果出力
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# モジュールのインポート
import math
import itertools


def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力を取得
    """
    N = int(input())
    x, y = [], []
    for n in range(N):
        x_n, y_n = list(map(int, input().split()))
        x.append(x_n)
        y.append(y_n)

    return N, x, y


def get_distance(x: list, y: list, i: int, j: int) -> float:
    """
    町iと町jの間の距離を取得する.

    Args:\n
        x (list): 町のx座標
        y (list): 町のy座標
        i (int): 町
        j (int): 町

    Returns:\n
        float: 町iと町jの間の距離
    """
    return math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)


def get_path_length(N: int, distance: dict, path: list) -> float:
    """
    経路の長さを求める.

    Args:\n
        N (int): 町の数
        distance (dict): 町間の距離
        path (list): 経路

    Returns:\n
        float: 経路の長さ
    """
    path_length = 0
    for n in range(N - 1):
        path_length += distance[(path[n], path[n + 1])]

    return path_length


def main(N: int, x: list, y: list) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 町の数
        x (list): 町のx座標
        y (list): 町のy座標
    """
    # 事前に町間の距離情報を作っておく
    distance = {}
    for i, j in itertools.product(range(N), repeat=2):
        distance[(i, j)] = get_distance(i, j)

    # 求解処理
    ans = 0
    for path in itertools.permutations(range(N)):
        ans += get_path_length(distance, path)
    ans /= math.factorial(N)

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N, x, y = get_input()

    # メイン処理
    main(N, x, y)


Fixed submission:
# -*- coding: utf-8 -*-
# モジュールのインポート
import math
import itertools

# 標準入力を取得
N = int(input())
x, y = [], []
for n in range(N):
    x_n, y_n = list(map(int, input().split()))
    x.append(x_n)
    y.append(y_n)


def get_distance(i: int, j: int) -> float:
    return math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)


def get_path_length(distance: dict, path: list) -> float:
    path_length = 0
    for n in range(N - 1):
        path_length += distance[(path[n], path[n + 1])]

    return path_length


# 求解処理
distance = {}
for i, j in itertools.product(range(N), range(N)):
    distance[(i, j)] = get_distance(i, j)

ans = 0
for path in itertools.permutations(range(N)):
    ans += get_path_length(distance, path)
ans /= math.factorial(N)

# 結果出力
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# モジュールのインポート
import math

# 標準入力の取得
A, B, C, D = list(map(int, input().split()))


def lcm(x: int, y: int) -> int:
    return (x * y) // math.gcd(x, y)


# 求解処理
div_C = (B // C) - ((A - 1) // C)
div_D = (B // D) - ((A - 1) // D)
lcm_CD = lcm(C, D)
div_lcm_CD = (B // lcm_CD) - ((A - 1) // lcm_CD)
result = (B - A + 1) - div_C - div_D + div_lcm_CD

# 結果出力
print(result)


Fixed submission:
# -*- coding: utf-8 -*-
# モジュールのインポート
from fractions import gcd

# 標準入力の取得
A, B, C, D = list(map(int, input().split()))


def lcm(x: int, y: int) -> int:
    return (x * y) // gcd(x, y)


# 求解処理
div_C = (B // C) - ((A - 1) // C)
div_D = (B // D) - ((A - 1) // D)
lcm_CD = lcm(C, D)
div_lcm_CD = (B // lcm_CD) - ((A - 1) // lcm_CD)
result = (B - A + 1) - div_C - div_D + div_lcm_CD

# 結果出力
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 標準入力の取得
R, G, B, N = list(map(int, input().split()))

# 求解処理
r_max = N // R
g_max = N // G
result = 0
for r in range(r_max+1):
    n_r = r * R
    for g in range(g_max+1):
        n_rg = n_r + g*G
        if N < n_rg:
            continue
        if (N - n_rg) % B == 0:
            result += 1


# 結果出力
print(result)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力の取得
R, G, B, N = list(map(int, input().split()))


def main() -> None:
    # 求解処理
    r_max = N // R
    g_max = N // G
    result = 0
    for r in range(r_max+1):
        n_r = r * R
        for g in range(g_max+1):
            n_rg = n_r + g*G
            if N < n_rg:
                continue
            if (N - n_rg) % B == 0:
                result += 1

    # 結果出力
    print(result)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# モジュールのインポート
import sympy as sp

# 標準入力を取得
N = int(input())

# 求解処理
ans = 0
for n in range(1, N + 1, 2):
    if sp.divisor_count(n) == 8:
        ans += 1

# 結果出力
print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

# 求解処理
ans = 0
for n in range(1, N + 1, 2):
    divisors_count = 0
    for i in range(1, n + 1):
        if n % i == 0:
            divisors_count += 1
    if divisors_count == 8:
        ans += 1

# 結果出力
print(ans)