Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
n, k = map(int, input().split())
d = 10 ** 9 + 7
i = 1
while n - k + 1 >= i and k >= i:
  print(((comb(n - k + 1, i, exact=True) % d) * (comb(k-1, i-1, exact=True) % d)) % d)
  i += 1

Fixed submission:
def comb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

n, k = map(int, input().split())
i = 1
for i in range(1, k+1):
  if n - k + 1 >= i:
    print((comb(n - k + 1, i, mod) * comb(k-1, i-1, mod) ) % mod)
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
n, k = map(int, input().split())
nc2 = (n - 1) * (n - 2) // 2
if nc2 < k:
  print('-1')
  exit()
print(n - 1 + (nc2 - k))  # M
for i in range(2, n+1):
  print(f'1 {i}')
for i in range(-1 + (nc2 - k)):
  combs = list(combinations(range(2, n), 2))
  print(f'{combs[i][0]} {combs[i][1]}')


Fixed submission:
from itertools import combinations
n, k = map(int, input().split())
nc2 = (n - 1) * (n - 2) // 2
if nc2 < k:
  print('-1')
  exit()
print(n - 1 + (nc2 - k))  # M
for i in range(2, n+1):
  print(f'1 {i}')
for i in range(nc2 - k):
  combs = list(combinations(range(2, n+1), 2))
  print(f'{combs[i][0]} {combs[i][1]}')
Buggy python submission (verdict: Time Limit Exceeded):
x, a = map(int, input().split())
print('0') if x < a else print('10')
cons = 10 ** 8
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
primes(cons)

Fixed submission:
x, a = map(int, input().split())
print('0') if x < a else print('10')
Buggy python submission (verdict: Runtime Error):
N = input()
T,A = int(input().split())
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Fixed submission:
N = input()
T,A = map(int,input().split())
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
N = input()
T,A = input().split()
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Fixed submission:
N = input()
T,A = map(int,input().split())
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
N = input()
T,A = input().split()
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Fixed submission:
N = input()
T,A = map(int,input().split())
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
N = input()
T,A = input().split()
H = list(map(lambda x: abs(T - x * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Fixed submission:
N = input()
T,A = map(int,input().split())
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
N = input()
T,A = input().split()
H = map(lambda x: abs(T - x * 0.006 - A),input().split())
print(min(H))

Fixed submission:
N = input()
T,A = map(int,input().split())
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split())
print(max(A)-min(A))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
print(max(A)-min(A))
Buggy python submission (verdict: Time Limit Exceeded):
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
S = input()
ans = []
for i in range(N+1):
    ans.append(S[0:i].count('W') + S[i + 1:N + 1].count('E'))
print(str(min(ans)))


Fixed submission:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
S = input()
ans = S[1:N].count('E')
tmp = ans
for i in range(N-1):
    if S[i] == 'W':
        tmp += 1
    if S[i + 1] == 'E':
        tmp -= 1
    ans = min(tmp, ans)
print(str(ans))

Buggy python submission (verdict: Time Limit Exceeded):
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
S = list(input())
ans = []
for i in range(N+1):
    ans.append(S[0:i].count('W') + S[i + 1:N + 1].count('E'))
print(str(min(ans)))


Fixed submission:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
S = input()
ans = S[1:N].count('E')
tmp = ans
for i in range(N-1):
    if S[i] == 'W':
        tmp += 1
    if S[i + 1] == 'E':
        tmp -= 1
    ans = min(tmp, ans)
print(str(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input()) % 500 # N:払いたい金額
A = int(input()) # A:1円玉の保持数
print("No" if n > A else "Yes")

Fixed submission:
n = int(input()) % 500 # N:払いたい金額
A = int(input()) # A:1円玉の保持数
print("No" if n > A else "Yes")

Buggy python submission (verdict: Runtime Error):
N = input() # N:払いたい金額
n = N % 500
A = input() # A:1円玉の保持数
print("No" if n > A else "Yes")

Fixed submission:
n = int(input()) % 500 # N:払いたい金額
A = int(input()) # A:1円玉の保持数
print("No" if n > A else "Yes")

Buggy python submission (verdict: Runtime Error):
n = input() % 500 # N:払いたい金額
A = input() # A:1円玉の保持数
print("No" if n > A else "Yes")

Fixed submission:
n = int(input()) % 500 # N:払いたい金額
A = int(input()) # A:1円玉の保持数
print("No" if n > A else "Yes")
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = true)))
print("Yes" if S < T else "No")


Fixed submission:
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = True)))
print("Yes" if S < T else "No")

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
S = ''.join(sort(list(s)))
T = ''.join(reverse(list(t)))
print("Yes" if S < T else "No")


Fixed submission:
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = True)))
print("Yes" if S < T else "No")

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
S = ''.join(reverse(list(s)))
T = ''.join(reverse(list(t)))
print("Yes" if S < T else "No")


Fixed submission:
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = True)))
print("Yes" if S < T else "No")

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
S = ''.join(list(s).sort)
T = ''.join(list(t).reverse)
print("Yes" if S < T else "No")


Fixed submission:
s = input()
t = input()
S = ''.join(list(sorted(s)))
T = ''.join(list(sorted(t,reverse = True)))
print("Yes" if S < T else "No")
Buggy python submission (verdict: Runtime Error):
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = set(A)
    L = [0 for i in range(N+1)]
    for i in A:
        L[i] += 1
    L.sort()
    if len(B) <= K:
        print('0')
    else:
        print(str(sum(L[0:N+1-K])))


if __name__ == "__main__":
    main()


Fixed submission:
a = input()
print(int(a[0]) + int(a[1]) +int(a[2]))

Buggy python submission (verdict: Runtime Error):
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N, K = map(int, input().split())
A = list(map(int, input().split()))
L = [0] * len(set(A))
tmp = 0
for i in set(A):
    L[tmp] = A.count(i)
    tmp += 1
L.sort()
if len(set(A)) <= K:
    print('0')
else:
    print(str(sum(L[0:len(set(A))-K])))


Fixed submission:
a = input()
print(int(a[0]) + int(a[1]) +int(a[2]))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
L = [0] * len(set(A))
tmp = 0
for i in set(A):
    L[tmp] = A.count(i)
    tmp += 1
L.sort()
if len(set(A)) <= K:
    print('0')
else:
    print(str(sum(L[0:len(set(A))-K])))


Fixed submission:
a = input()
print(int(a[0]) + int(a[1]) +int(a[2]))
Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
ans = 0
for i in A:
  tmp = 0 
  while i % 2 == 0:
    i = i / 2
    tmp += 1
  ans = tmp if ans = 0 else min(ans,tmp)
print(ans)

Fixed submission:
N = input()
A = list(map(int,input().split()))
B = []
for i in A:
  tmp = 0 
  while i % 2 == 0:
    i = i / 2
    tmp += 1
  B.append(tmp)
print(min(B))

Buggy python submission (verdict: Runtime Error):
N = input()
A = map(int,input().split())
ans = 0
for i in A:
  while i % 2 = 0:
    tmp = 0 
    i = i / 2
    tmp += 1
  if tmp > ans:
    ans = tmp
print(ans)

Fixed submission:
N = input()
A = list(map(int,input().split()))
B = []
for i in A:
  tmp = 0 
  while i % 2 == 0:
    i = i / 2
    tmp += 1
  B.append(tmp)
print(min(B))
Buggy python submission (verdict: Runtime Error):
S = input()
l = len(int(S))
print(S[0] + l +S[l-1])

Fixed submission:
S = input()
l = len(S)
print(S[0] + str(l-2) + S[l-1])

Buggy python submission (verdict: Runtime Error):
S = input()
l = len(S)
print(S[0] + l +S[l-1])

Fixed submission:
S = input()
l = len(S)
print(S[0] + str(l-2) + S[l-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
int ans = 1
while N > ans:
  ans = ans * 2
ans = N if ans == N else ans/2
print(ans)


Fixed submission:
N = int(input())
ans = 1
while N > ans:
  ans = ans * 2
ans = N if ans == N else ans//2
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 1
while N > ans:
  ans = ans * N2
print(int(ans/2))


Fixed submission:
N = int(input())
ans = 1
while N > ans:
  ans = ans * 2
ans = N if ans == N else ans//2
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
s = None//初期値
for i in range(len(S)):
  c = S[i]
  if c == "A":
    s = i
  if c == "Z":
    e = i
print(e-s+1)


Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)

Buggy python submission (verdict: Runtime Error):
S = input()
s = None//初期値
for i in range(len(S)):
  c = S[i]
  if c == "A" and s is None :
    s = i
  if c == "Z":
    e = i
print(e-s+1)


Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)

Buggy python submission (verdict: Runtime Error):
S = input()
for i in range(len(S)):
  c = S[i]
  if c == "A" and s is None :s = i
  if c == "Z":e = i
print(e-s+1)


Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)

Buggy python submission (verdict: Runtime Error):
S = input()
s = 0
for i in range(len(S)):
  c = S[i]
  s = i if c == "A" and s == 0
  if c == "Z":
    print(S[s:i+1])
    break

Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)

Buggy python submission (verdict: Runtime Error):
S = input()
s=0
for i in range(len(S)):
  c = S[i]
  s = i if c =="A" && s <> 0
  if c =="Z":
    print(S[s:i+1])
    break

Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)

Buggy python submission (verdict: Runtime Error):
S = input()
s=0
for i in len(S):
  c = S[i]
  s = i if c =="A" && s <> 0
  if c =="Z":
    print(S[s:i+1])
    break

Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)

Buggy python submission (verdict: Runtime Error):
S = input()
for i in len(S):
  c = S[i]
  s = i if c =='A'
  if c =='Z':
    print(S[s:i+1])
    break

Fixed submission:
S = input()
L = len(S)
for i in range(L):
  c = S[i]
  if c == "A":
    s = i
    break
for i in range(L):
  c = S[-(i+1)]
  if c == "Z":
    e = L - (i+1)
    break
print(e-s+1)
Buggy python submission (verdict: Runtime Error):
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
from math import factorial
K, S = map(int, input().split())
S = S if K * 3 / 2 > S else K * 3 - S
count = int(factorial(S+2) / factorial(2) / factorial(S+2 - 2))
print(str(count))


Fixed submission:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K and z >= 0:
            count += 1
print(str(count))

Buggy python submission (verdict: Runtime Error):
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
from scipy.special import comb
K, S = map(int, input().split())
S = S if K * 3 / 2 - S > 0 else K * 3 - S
count = comb(S + 2, 2, exact=True)
print(str(count))


Fixed submission:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
K, S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K and z >= 0:
            count += 1
print(str(count))
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = []
for i in rangeN):
    S.append(input())
print(('').join(sorted(S)))


Fixed submission:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N, L = map(int, input().split())
S = []
for i in range(N):
    S.append(input())
print(('').join(sorted(S)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
ans = 1
for i in a:
    ans = ans*int(i)
if ans > 1000000000000000000:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
a = input().split()
ans = 1
if '0' in a:
    ans = 0
else:
    for i in a:
        ans = ans*int(i)
        if ans > 1000000000000000000:
            print(-1)
            exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
X,K,D = map(int,input().split())
ans=X
min_abs = 10**15
for i in range(K):
  ans = min(abs(ans+D),abs(ans-D))
  
print(ans)

Fixed submission:
X,K,D = map(int,input().split())

def sgn(x):
  if x > 0:return 1
  if x < 0:return -1
  return 0

if X > 0:
  x_greedy = X - K*D
else:
  x_greedy = X + K*D
  
if sgn(X) == sgn(x_greedy):
  print(abs(x_greedy))
  exit()
x_r = X%D
x_l = x_r - D

r_parity = (abs(X-x_r)//D)%2

if K%2 == r_parity:
  print(abs(x_r))
else:
  print(abs(x_l))
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N = map(int,input().split())
max_num = 0
num = 0
for i in range(1,N+1):
  if (A*i//B) - A*(i//B) > max_num:
    max_num = (A*i//B) - A*(i//B)
    num = i
    
print(max_num)

Fixed submission:
A,B,N = map(int,input().split())
num = min(B-1,N)

print((A*num//B)-A*(num//B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N = map(int,input().split())
max = 0
for i in range(1,N+1):
  num = int((A * i)/B) - A * int(i/B)
  if num > max:
    max = num
    
print(max)

Fixed submission:
A,B,N = map(int,input().split())
num = min(B-1,N)

print((A*num//B)-A*(num//B))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a_list
for i in range(N):
  a_list.append(input())
  
a_ = set(a_list)

a_num = len(a_)

print(a_num)

Fixed submission:
N = int(input())
a_list=[]
for i in range(N):
  a_list.append(input())
  
a_set = set(a_list)

a_num = len(a_set)

print(a_num)

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

a_list = []

for i in range(N):
  a_list.append(list(input()))
  
a_num = len(set(a_list))

print(a_num)

Fixed submission:
N = int(input())
a_list=[]
for i in range(N):
  a_list.append(input())
  
a_set = set(a_list)

a_num = len(a_set)

print(a_num)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,inuput().split())
A = list(map(int,input().split()))

total = 0
for i in range(M):
  total += A[i]
  
if N - total >= 0:
  print(N - total)
  
else:
  print("-1")

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

total = 0
for i in range(M):
  total += A[i]
  
if N - total >= 0:
  print(N - total)
  
else:
  print("-1")
Buggy python submission (verdict: Runtime Error):
K,N = map(int,input().split())

A = []

for i in range(N):
  A.append(int(input()))
  
A_m = []

for i in range(1,N):
  A_m.append(A[i]-A[i-1])
  
A_m.append(K-A[N-1]+A[0])
  
print(sum(A_m)-max(A_m))


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

  
A_m = []
 
for i in range(1,N):
  A_m.append(A[i]-A[i-1])
  
A_m.append(K-A[N-1]+A[0])
  
print(sum(A_m)-max(A_m))

Buggy python submission (verdict: Runtime Error):
K,N = map(int,input().split())
A = []
for i in range(N):
  A.append(int(input()))
A_m=[]

for i in range(1,N):
    A_m.append(int(A[i] - A[i-1]))
  

if abs(A[N-1]-A[0]) > 10:
  A_m.append(A[0]-A[N-1] +20)
else:
  A_m.append(A[N-1]-A[0])
  
X = sum(A_m) - max(A_m)

print(X)

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

  
A_m = []
 
for i in range(1,N):
  A_m.append(A[i]-A[i-1])
  
A_m.append(K-A[N-1]+A[0])
  
print(sum(A_m)-max(A_m))
Buggy python submission (verdict: Runtime Error):
k_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(k_list[K])

Fixed submission:
k_list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())
print(k_list[K-1])
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())

if H == 1 or W == 1:
  return 1
else:
  cnt = (H * W + 1) // 2
  return cnt

Fixed submission:
H,W = map(int,input().split())
 
if H == 1 or W == 1:
  print(1)
else:
  cnt = (H * W + 1) // 2
  print(cnt)

Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())

ban = []

for j in range(W):
  ban.append(0)

banmen=[]

for i in range(H):
  banmen.append(ban)
  
banmen[0][0] = 1
cnt = 1

for i in range(H):
  for j in range(W):
    if banmen[i][j] != 1:
      continue
    if i-1 >= 0 and j-1 >= 0 and banmen[i-1][j-1] != 1:
      banmen[i-1][j-1] = 1
      cnt+=1
    elif i-1 >= 0 and j+1 <= len(ban) and banmen[i-1][j+1] != 1:
      banmen[i-1][j+1] = 1
      cnt+=1
    elif i+1 <= H and j-1 >= 0 and banmen[i+1][j-1] != 1:
      banmen[i+1][j-1] = 1
      cnt+=1
    elif i+1 <= H and j+1 <= W and banmen[i+1][j+1] != 1:
      banmen[i+1][j+1] = 1
      cnt+=1
print(cnt)

Fixed submission:
H,W = map(int,input().split())
 
if H == 1 or W == 1:
  print(1)
else:
  cnt = (H * W + 1) // 2
  print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

x,y,z = map(int,input())

x = math.sqrt(x)
y = math.sqrt(y)
z = math.sqrt(z)

if x + y < z:
  print("Yes")
else:
  print("No")

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

d = c-b-a

if d > 0 and d**2 > 4*a*b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())
result = 0
for i in range(N+1):
    a = (A * i) // B - A * (i // B)
    if a > result:
        result = a
print(result)

Fixed submission:
A, B, N = map(int, input().split())
#result = int(((N/B-int(N/B))*A))
ma = min(N,B-1)
result = int(((ma/B-int(ma/B))*A))
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
boss = [0] + list(map(int, input().split()))
#print(boss)
for i in range(n):
    print(boss.count(i+1))
    del boss[0]

Fixed submission:
n = int(input())
dicti = {}
boss = list(map(int, input().split()))
for i in boss:
    if i in dicti:
        dicti[i] += 1
    else:
        dicti[i] = 1
#print(dicti)
for j in range(1,n+1):
    try:
        print(dicti[j])
    except:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
boss = [0] + list(map(int, input().split()))
#print(boss)
for i in range(n):
    print(boss.count(i+1))

Fixed submission:
n = int(input())
dicti = {}
boss = list(map(int, input().split()))
for i in boss:
    if i in dicti:
        dicti[i] += 1
    else:
        dicti[i] = 1
#print(dicti)
for j in range(1,n+1):
    try:
        print(dicti[j])
    except:
        print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
num = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            num += math.gcd(i, math.gcd(j,k))
print(num)

Fixed submission:
import math
n = int(input())
num = 0
tmp = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        tmp = math.gcd(i,j) 
        for k in range(1,n+1):
            num += math.gcd(tmp, k)
            tmp == 0
print(num)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
num = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        for k in range(1,n+1):
            num += math.gcd(i, math.gcd(j,k))
print(num)

Fixed submission:
import math
n = int(input())
num = 0
tmp = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        tmp = math.gcd(i,j) 
        for k in range(1,n+1):
            num += math.gcd(tmp, k)
            tmp == 0
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z==S:
                count += 1
print(count)

Fixed submission:
K,S = map(int, input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        if 0<=S-x-y<=K:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
x = list(map(int, input().split()))
x_l = [1,2,3,4,5]

for i in range(ren(x_l)):
    if x_l[i] != x[i]:
        print(i+1)

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

for i in range(len(x)):
    if x[i] == 0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
s = input()

if s is "ABC":
  print("ARC"):
else:
  print("ABC")

Fixed submission:
s = input()

if s == "ABC":
    print("ARC")
if s == "ARC":
    print("ABC")
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
num = [0]*n
chk = [0]*n
for _ in range(m):
    a, b = map(int, input().split())
    num[a-1] += 1
    num[b-1] += 1
    if h[a-1]>h[b-1]:
        chk[a-1] += 1
    elif h[b-1]>h[a-1]:
        chk[b-1] += 1
ans = 0
for i in range(m):
    if num[i]==chk[i]:
        ans += 1
print(ans)

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))

ma = [0]*n
for _ in range(m):
    a, b = map(int, input().split())
    ma[a-1] = max(h[b-1], ma[a-1])
    ma[b-1] = max(h[a-1], ma[b-1])

ans = 0
for i in range(n):
    if h[i]>ma[i]:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
input_list = map(int, input().split())

flag = False
for idx in input_list:
  if idx>=1 and idx<=100:
    flag = True
  if flag is False:
    break
  
turn = 0
if flag:
  A, B, C, D = input_list
  continue_flag = True
  while continue_flag:
    if turn%2==0:
      C -= B
      if C<=0:
        print("Yes")
        continue_flag = False
      turn += 1
    else:
      A -= D
      if A<=0:
        print("No")
        continue_flag = False
      turn += 1
      
      

Fixed submission:
input_list = list(map(int, input().split()))

flag = False
for idx in input_list:
    if idx>=1 and idx<=100:
        flag = True
    if flag is False:
        break
  
turn = 0
if flag:
    A, B, C, D = input_list
    continue_flag = True
    while continue_flag:
        if turn%2==0:
          C -= B
          if C<=0:
            print("Yes")
            continue_flag = False
          turn += 1
        else:
          A -= D
          if A<=0:
            print("No")
            continue_flag = False
          turn += 1