Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict as dd
sys.setrecursionlimit(4100000)

def dfs(node):
  global ts
  visited[node-1] = True
  first_order[node-1] = ts
  ts += 1
  
  for next_node in tree[node]:
    if visited[next_node-1]:
      continue
    dfs(next_node)
  
  last_order[node-1] = ts
  ts += 1

N, Q = map(int, input().split())
tree = dd(list)
visited = [False] * N
first_order = [0] * N
last_order = [0] * N
ts = 0
counter = [0] * N
operation = []
for _ in range(N-1):
  a, b = map(int, input().split())
  tree[a].append(b) 
  tree[b].append(a) 
for _ in range(Q):
  operation.append(tuple(map(int, input().split())))

dfs(1)
for p, x in operation:
  for i in range(N):
    if first_order[p-1] <= first_order[i-1] and last_order[i-1] <= last_order[p-1]:
      counter[i-1] += x
print(*counter)

Fixed submission:
import sys
from collections import defaultdict as dd
sys.setrecursionlimit(4100000)

def dfs(node):
  visited[node-1] = True
  
  for next_node in tree[node]:
    if visited[next_node-1]:
      continue
    counter[next_node-1] += counter[node-1]
    dfs(next_node)

N, Q = map(int, input().split())
tree = dd(list)
visited = [False] * N
counter = [0] * N
operation = []
for _ in range(N-1):
  a, b = map(int, input().split())
  tree[a].append(b) 
  tree[b].append(a) 
for _ in range(Q):
  operation.append(tuple(map(int, input().split())))
  
for p, x in operation:
  counter[p-1] += x
dfs(1)
print(*counter)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict as dd
sys.setrecursionlimit(4100000)

def dfs(node):
  global ts
  visited[node-1] = True
  first_order[node-1] = ts
  ts += 1
  
  for next_node in tree[node]:
    if visited[next_node-1]:
      continue
    dfs(next_node)
  
  last_order[node-1] = ts
  ts += 1

N, Q = map(int, input().split())
tree = dd(list)
operation = []
counter = [0] * N
for _ in range(N-1):
  a, b = map(int, input().split())
  tree[a].append(b) 
  tree[b].append(a) 
for _ in range(Q):
  operation.append(tuple(map(int, input().split())))

for p, x in operation:
  visited = [False] * N
  first_order = [0] * N
  last_order = [0] * N
  ts = 0
  dfs(1)
  for i in range(N):
    if first_order[p-1] <= first_order[i-1] and last_order[i-1] <= last_order[p-1]:
      counter[i-1] += x
print(*counter)

Fixed submission:
import sys
from collections import defaultdict as dd
sys.setrecursionlimit(4100000)

def dfs(node):
  visited[node-1] = True
  
  for next_node in tree[node]:
    if visited[next_node-1]:
      continue
    counter[next_node-1] += counter[node-1]
    dfs(next_node)

N, Q = map(int, input().split())
tree = dd(list)
visited = [False] * N
counter = [0] * N
operation = []
for _ in range(N-1):
  a, b = map(int, input().split())
  tree[a].append(b) 
  tree[b].append(a) 
for _ in range(Q):
  operation.append(tuple(map(int, input().split())))
  
for p, x in operation:
  counter[p-1] += x
dfs(1)
print(*counter)
Buggy python submission (verdict: Time Limit Exceeded):
INF = 10**9
N, K = map(int, input().split())
h = list(map(int, input().split()))
cost = [INF] * N
cost[0] = 0
for i in range(1, N):
  for j in range(1, min(i, K)+1):
    cost[i] = min(cost[i], cost[i-j] + abs(h[i] - h[i-j]))
print(cost[N-1])

Fixed submission:
INF = 10**9
N, K = map(int, input().split())
h = list(map(int, input().split()))
cost = [INF] * N
cost[0] = 0
for i in range(1, N):
  for j in range(1, min(i, K)+1):
    cost[i] = min(cost[i], cost[i-j] + abs(h[i] - h[i-j]))
print(cost[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, W = map(int, input().split())
value, weight = [0], [0]
for _ in range(N):
  w, v = map(int, input().split())
  weight.append(w)
  value.append(v)
dp = [[-1]*(W+1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(1, N+1):
  for j in range(W+1):
    dp[i][j] = max(dp[i][j], dp[i-1][j])
    if -1 < j-weight[i]:
      dp[i][j] = max(dp[i][j], dp[i-1][j-weight[i]]+ value[i])
print(max(dp[N]))

Fixed submission:
N, W = map(int, input().split())
value, weight = [0], [0]
for _ in range(N):
  w, v = map(int, input().split())
  weight.append(w)
  value.append(v)
dp = [[-1]*(W+1) for _ in range(N+1)]
dp[0][0] = 0

for i in range(1, N+1):
  for j in range(W+1):
    dp[i][j] = max(dp[i][j], dp[i-1][j])
    if -1 < j-weight[i]:
      dp[i][j] = max(dp[i][j], dp[i-1][j-weight[i]]+ value[i])
print(max(dp[N]))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
  x, y = map(lambda x: int(x)-1, input().split())
  graph[x].append(y)

dp = [-1]*N
def rec(v):
  if dp[v] != -1:
    return dp[v]
  
  res = 0
  for nv in graph[v]:
    res = max(res, rec(nv)+1)
  dp[v] = res
  return res

res = 0
for v in range(N):
  res = max(res, rec(v))
print(res)

Fixed submission:
from sys import setrecursionlimit
setrecursionlimit(10**7)

N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
  x, y = map(lambda x: int(x)-1, input().split())
  graph[x].append(y)

dp = [-1]*N
def rec(v):
  if dp[v] != -1:
    return dp[v]
  
  res = 0
  for nv in graph[v]:
    res = max(res, rec(nv)+1)
  dp[v] = res
  return res

res = 0
for v in range(N):
  res = max(res, rec(v))
print(res)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
  x, y = map(lambda x: int(x)-1, input().split())
  graph[x].append(y)

dp = [-1]*N
def rec(v):
  if dp[v] != -1:
    return dp[v]
  
  res = 0
  for nv in graph[v]:
    res = max(res, rec(nv)+1)
  dp[v] = res
  return res

res = 0
for i in range(N):
  res = max(res, rec(i))
print(res)

Fixed submission:
from sys import setrecursionlimit
setrecursionlimit(10**7)

N, M = map(int, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
  x, y = map(lambda x: int(x)-1, input().split())
  graph[x].append(y)

dp = [-1]*N
def rec(v):
  if dp[v] != -1:
    return dp[v]
  
  res = 0
  for nv in graph[v]:
    res = max(res, rec(nv)+1)
  dp[v] = res
  return res

res = 0
for v in range(N):
  res = max(res, rec(v))
print(res)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
import numpy as np
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

n = int(input())
d1 = [] * n
d2 = [] * n

for i in range(n):
    x, y = map(int, input().split())
    d1.append(x+y)
    d2.append(x-y)

print(max(max(d1) - min(d1), max(d2)-min(d2)))


Fixed submission:
# -*- coding: utf-8 -*-
# E

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

n = int(input())
d1 = [] * n
d2 = [] * n

for i in range(n):
    x, y = map(int, input().split())
    d1.append(x+y)
    d2.append(x-y)

print(max(max(d1) - min(d1), max(d2)-min(d2)))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [ int(a) for a in input().split() ]
A.sort(reverse=True)
 
for m in range(M):
    A[0] = A[0] // 2
    A.sort(reverse=True)
 
print(sum(A))

Fixed submission:
S = input()

if S == 'Sunny':
    print('Cloudy')
elif S =='Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy python submission (verdict: Runtime Error):
s = input()

if S == 'Sunny':
    print('Cloudy')
elif S =='Cloudy':
    print('Rainy')
else:
    print('Sunny')

Fixed submission:
S = input()

if S == 'Sunny':
    print('Cloudy')
elif S =='Cloudy':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [ int(a) for a in input().split() ]
A.sort(reverse=True)
 
for m in range(M):
    A[0] = A[0] // 2
    A.sort(reverse=True)
 
print(sum(A))

Fixed submission:
import heapq
import math

N, M = map(int, input().split())
A = [ -int(a) for a in input().split() ]
heapq.heapify(A)
for m in range(M):
    heapq.heappush(A, math.ceil(heapq.heappop(A) / 2.0))

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [ int(a) for a in input().split() ]
A.sort(reverse=True)

for m in range(M):
    A[0] = A[0] // 2
    A.sort(reverse=True)

print(sum(A))


Fixed submission:
import heapq
import math

N, M = map(int, input().split())
A = [ -int(a) for a in input().split() ]
heapq.heapify(A)
for m in range(M):
    heapq.heappush(A, math.ceil(heapq.heappop(A) / 2.0))

print(-sum(A))
Buggy python submission (verdict: Runtime Error):
a = input()
s= input()

if a >= 3200:
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()

print(s if a >= 3200 else 'red')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max([a+b, a-b, a*b])

Fixed submission:
A, B = map(int, input().split())

print(max(A+B, A-B, A*B))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [list(input()) for _ in range(N)]
for i in range(N):
    S[i] = sorted(S[i])
S = sorted(S)

count = 0
for i in range(N):
    for j in range(i+1, N):
        if S[i] == S[j]:
            count += 1
        else:
            i = j+1
            break

print(count)

Fixed submission:
N = int(input())
dic = {}
s = 0
for n in range(N):
  v = ''.join(sorted(input()))
  if dic.get(v) is None:
    dic[v] = 1
  else:
    s += dic[v]
    dic[v] += 1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [list(input()) for _ in range(N)]
for i in range(N):
    S[i] = sorted(S[i])
S = sorted(S)

count = 0
for i in range(N):
    for j in range(i+1, N):
        if S[i] == S[j]:
            count += 1
        else:
            break

print(count)

Fixed submission:
N = int(input())
dic = {}
s = 0
for n in range(N):
  v = ''.join(sorted(input()))
  if dic.get(v) is None:
    dic[v] = 1
  else:
    s += dic[v]
    dic[v] += 1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [list(input()) for _ in range(N)]
for i in range(N):
    S[i] = sorted(S[i])
S = sorted(S)

count = 0
for i in range(N):
    for j in range(i+1, N):
        if S[i] == S[j]:
            count += 1
        else:
            break

print(count)

Fixed submission:
N = int(input())
dic = {}
s = 0
for n in range(N):
  v = ''.join(sorted(input()))
  if dic.get(v) is None:
    dic[v] = 1
  else:
    s += dic[v]
    dic[v] += 1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [list(input()) for _ in range(N)]
for i in range(N):
    S[i] = sorted(S[i])

count = 0
for i in range(N):
    count += S.count(S[i]) - 1

print(count // 2)

Fixed submission:
N = int(input())
dic = {}
s = 0
for n in range(N):
  v = ''.join(sorted(input()))
  if dic.get(v) is None:
    dic[v] = 1
  else:
    s += dic[v]
    dic[v] += 1
print(s)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())
K = int((A+B)//2)
if abs(A-K) == abs(B-K):
  print(K)
else:
  print('IMPOSSIBLE')

Fixed submission:
A, B = map(int, input().split())
K = int((A+B)//2)
if abs(A-K) == abs(B-K):
  print(K)
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
import fractions

A, B, C, D = map(int, input().split())

count = B - A + 1
lcd_of_CD = C * D // fractions.gcd(C, D)

count -= B // C
count += (A - 1) // C
count -= B // D
count += (A - 1) // D
count += B // lcd_of_CD
count -= (A - 1) // lcd_of_CD

print(count)

Fixed submission:
S = input()

for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        print('Bad')
        exit()
print('Good')

Buggy python submission (verdict: Runtime Error):
import fractions

A, B, C, D = map(int, input().split())

count = B - A + 1
lcd_of_CD = C * D // math.gcd(C, D)

count -= B // C
count += (A - 1) // C
count -= B // D
count += (A - 1) // D
count += B // lcd_of_CD
count -= (A - 1) // lcd_of_CD

print(count)

Fixed submission:
S = input()

for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        print('Bad')
        exit()
print('Good')
Buggy python submission (verdict: Runtime Error):
import math

A, B, C, D = map(int, input().split())

count = B - A + 1
lcd_of_CD = C * D // math.gcd(C, D)

count -= B // C
count += (A - 1) // C
count -= B // D
count += (A - 1) // D
count += B // lcd_of_CD
count -= (A - 1) // lcd_of_CD

print(count)

Fixed submission:
import fractions

A, B, C, D = map(int, input().split())

count = B - A + 1
lcd_of_CD = C * D // fractions.gcd(C, D)

count -= B // C
count += (A - 1) // C
count -= B // D
count += (A - 1) // D
count += B // lcd_of_CD
count -= (A - 1) // lcd_of_CD

print(count)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

minutes = 0
items = [A, B, C, D, E]
rems = [item % 10 for item in items if item % 10 != 0]
cnt = len(rems)
minutes += min(rems)

for item in items:
    minutes += (item//10)*10
 
if cnt > 0:
    minutes += (cnt-1)*10

print(minutes)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

minutes = 0
items = [A, B, C, D, E]
rems = [item % 10 for item in items if item % 10 != 0]
cnt = len(rems)


for item in items:
    minutes += (item//10)*10
 
if cnt > 0:
    minutes += (cnt-1)*10
    minutes += min(rems)

print(minutes)
Buggy python submission (verdict: Runtime Error):
s = input()

if s == 'A':
  print('T')
elfi s == 'T':
  print('A')
elif s == 'C':
  print('G')
else:
  print('C')

Fixed submission:
b = input()

if b == 'A': print('T')
elif b == 'T': print('A')
elif b == 'G': print('C')
else: print('G')
Buggy python submission (verdict: Time Limit Exceeded):
def countAC(s, stt, end):
    count = 0
    for i in range(stt, end-1):
        if (s[i] == 'A' and s[i+1] == 'C'):
            count += 1
    return count

N, Q = map(int, input().split())
S = input()
ans = []
for q in range(Q):
    l, r = map(int, input().split())
    ans.append(countAC(S, l-1, r))

for q in range(Q):
    print(ans[q])

Fixed submission:
N, Q = map(int, input().split())
S = input()

count_list = [0] * (N+1)
count = 0
for n in range(N-1):
    if (S[n] == 'A' and S[n+1] == 'C'):
        count += 1
    count_list[n+2] = count

ans = []
for q in range(Q):
    l, r = map(int, input().split())
    ans.append(count_list[r] - count_list[l])

for q in range(Q):
    print(ans[q])
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input())
h, w = map(int, input())
print((H-h)*(W-w))

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


print((H-h)*(W-w))
Buggy python submission (verdict: Runtime Error):
def min_cost(N, K, Hn):
    costs = [[0 for k in range(K+1)] for n in range(N+1)]
    
    # N = 2 または K = 1 のとき
    for k in range(1, K+1):
        costs[2][k] = abs(Hn[1] - Hn[0])
    for n in range(3, N+1):
        costs[n][1] = costs[n-1][1] + abs(Hn[n-1] - Hn[n-2])
    
    # その他
    for n in range(3, N+1):
        for k in range(2, K+1):
            if k >= n:
                costs[n][k] = costs[n][k-1]
            else:
                costs[n][k] = min(costs[n][k-1], min([costs[n-l][k] + abs(Hn[n-1] - Hn[n-1-l]) for l in range(1, k+1)]))

    return costs[N][K]

N, K = map(int, input().split(' '))
Hn = list(map(int, input().split(' ')))

print(min_cost(N, K, Hn))


Fixed submission:
def min_cost(n, hs):
    costs = [0 for _ in range(n)]
    costs[1] = abs(hs[1] - hs[0])
    for i in range(2, n):
        costs[i] = min(costs[i-1] + abs(hs[i]-hs[i-1]), costs[i-2] + abs(hs[i] - hs[i-2]))
    
    return costs[n-1]

N = int(input())
Hn = list(map(int, input().split(' ')))

print(min_cost(N, Hn))

Buggy python submission (verdict: Runtime Error):
def min_cost(n, hs):
    if (n == 2):
        return abs(hs[1] - hs[0])
    if (n == 3):
        return min(abs(hs[1] - hs[0]) + abs(hs[2] - hs[1]), abs(hs[2] - hs[0]))
    else:
        return min(min_cost(n-1, hs[:n-1:]) + abs(hs[n-1] - hs[n-2]), min_cost(n-2, hs[:n-2:]) + abs(hs[n-1] - hs[n-3]))

N = int(input())
Hn = list(map(int, input().split(' ')))

print(min_cost(N, Hn))

Fixed submission:
def min_cost(n, hs):
    costs = [0 for _ in range(n)]
    costs[1] = abs(hs[1] - hs[0])
    for i in range(2, n):
        costs[i] = min(costs[i-1] + abs(hs[i]-hs[i-1]), costs[i-2] + abs(hs[i] - hs[i-2]))
    
    return costs[n-1]

N = int(input())
Hn = list(map(int, input().split(' ')))

print(min_cost(N, Hn))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())

if a * b % 2 == 0:
    print("No")
else:
    print("Yes")

Fixed submission:
a, b = map(int, input().split())
 
if a * b % 2 == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
S = list(input().split())

if S[0] == '1':
  print(S[1])
else:
  print(S[0])

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

def func(N, K):
    for n in range(len(N)):
        if N[n] != 1:
            if K > n:
                return N[n]
    
    return 1

print(func(N, K))
Buggy python submission (verdict: Runtime Error):
import copy

N = int(input())
An = list(map(int, input().split()))
for n in range(N):
    An[n] -= (n+1)

An.sort()

if (N % 2 == 0):
    cent = An[N//2 - 1] + An[N//2] // 2
else:
    cent = An[(N-1)//2]

ans = sum(An) - N * cent

print(ans)



Fixed submission:
N = int(input())

if (N % 2 == 0):
    print(N)
else:
    print(2*N)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())

print( ((b-a) * (b-a) - b - a) / 2)

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

print( ((b-a) * (b-a) - b - a) // 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(len(set([input() for n in range(N)])))

Fixed submission:
print(input().replace('2017', '2018'))

Buggy python submission (verdict: Runtime Error):
N = int(input())
print(len(set([input() for n in range(N)])))

Fixed submission:
print(input().replace('2017', '2018'))

Buggy python submission (verdict: Runtime Error):
print(date = input().replace('2017', '2018'))

Fixed submission:
print(input().replace('2017', '2018'))
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input())

if A + B > C + D:
    print('Left')
elif A + B == C + D:
    print('Balanced')
else:
    print('Right')

Fixed submission:
A, B, C, D = map(int, input().split())

if A + B > C + D:
    print('Left')
elif A + B == C + D:
    print('Balanced')
else:
    print('Right')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
L = [int(l) for l in input().split()]
L.sort(reverse=True)

print(sum(L[0:K:]))

Fixed submission:
A, B = map(int, input().split())

if A % 3 == 0:
    print('Possible')
elif B % 3 == 0:
    print('Possible')
elif (A+B) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))

L.sort(reverse=True))
print(L[0:K+1])

Fixed submission:
N, K = map(int, input().split())
L = [int(l) for l in input().split()]
L.sort(reverse=True)

print(sum(L[0:K:]))
Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split()

print(s1[0].upper() + s2[0].uppter() + s3[0].upper())

Fixed submission:
s1, s2, s3 = input().split()
print(s1[0].upper() + s2[0].upper() + s3[0].upper())
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A = 1:
    A += 12
if B = 1:
    B += 12

if A < B:
    print('Alice')
if A > B:
    print('Bob')
else:
    print('Draw')

Fixed submission:
A, B = map(int, input().split())

if A == 1:
    A += 13
if B == 1:
    B += 13

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

if A < B:
    print('Alice')
if A > B:
    print('Bob')
else:
    print('Draw')

Fixed submission:
A, B = map(int, input().split())

if A == 1:
    A += 13
if B == 1:
    B += 13

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')
Buggy python submission (verdict: Runtime Error):
A, op, B = input().split()

num_A = int(A)
num_B = int(B)
if op == '+':
    print(num_A + numb_B)
else:
    print(num_A - num_B)

Fixed submission:
A, op, B = input().split()

num_A = int(A)
num_B = int(B)
if op == '+':
    print(num_A + num_B)
else:
    print(num_A - num_B)
Buggy python submission (verdict: Runtime Error):
c = input()

vowel = ['a', 'i', 'u', 'e', 'o']
if c in boin:
    print('vowel')
else:
    print('consonant')

Fixed submission:
c = input()

vowel = ['a', 'i', 'u', 'e', 'o']
if c in vowel:
    print('vowel')
else:
    print('consonant')
Buggy python submission (verdict: Runtime Error):
 print('ABC') if input() == 'ARC' else print('ARC')


Fixed submission:
S = input()
if S == 'ABC':
  print('ARC')
else:
  print('ABC')
Buggy python submission (verdict: Runtime Error):
x = int(input())
depo = 100
count = 0
while True:
  depo += int(depo / 100)
  count += 1
  if x == depo:
    break;
    
print(count)

Fixed submission:
x = int(input())
depo = 100
count = 0
while depo < x:
  depo += int(depo / 100)
  count += 1
  
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for i in range(N)]
check_list = []
count = 0

for i in range(N):
    if S[i] in check_list:
        continue;
    else:
        count += 1
        check_list.append(S[i])

print(count)


Fixed submission:
N = int(input())
S = [input() for i in range(N)]
check_dict = {}
for i in range(N):
    check_dict[S[i]] = 1

print(len(check_dict.keys()))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
worker_list = [0] * N

for i in range(0, N - 1):
    worker_list[A[i] - 1] += 1

for i in range(N):
    print(worker_list[i])


Fixed submission:
from math import gcd

def gcd_3(a, b, c):
    return gcd(gcd(a, b), c)
sum_gcd = 0
K = int(input())
for i in range(1, K + 1):
    for j in range(1, K + 1):
        for l in range(1, K + 1):
            sum_gcd += gcd_3(i, j, l)

print(sum_gcd)
Buggy python submission (verdict: Runtime Error):
s = input.split()
a, b = map(int, input.split())
u = input()

if(u in s[0]):
    print(str(a - 1) + ' ' + str(b))
elif(u in s[1]):
    print(str(a) + ' ' + str(b - 1))
else:
    print(str(a) + ' ' + str(b))


Fixed submission:
from sys import stdin

s, t = stdin.readline().rstrip().split()
a, b = [int(x) for x in stdin.readline().rstrip().split()]
u = input()

if (u in s):
    print(str(a - 1) + ' ' + str(b))
elif (u in t):
    print(str(a) + ' ' + str(b - 1))
else:
    print(str(a) + ' ' + str(b))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = 0

for i in range(0, N-1):
    for j in range(i+1, N):
        ans += A[i]*A[j]

div, mod = divmod(ans, 1000000007)

print(mod)


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


sum_a = sum(A)
ans = 0
mod = int(1e9+7)

for a in A:
    sum_a -= a
    ans += (sum_a * a) % mod

ans %= mod
print(int(ans))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
F = [list(map(int, input().split())) for i in range(M)]

G = []

for i, f in enumerate(F):
    new_grp = True
    for j, g in enumerate(G):
        if f[0] in g:
            if f[1] not in g:
                G[j].append(f[1])
                new_grp = False
        if f[1] in g:
            if f[0] not in g:
                G[j].append(f[0])
                new_grp = False
    if new_grp:
        G.append(f)

print(max(map(len, G)))


Fixed submission:
N, M = map(int, input().split())
F = [list(map(int, input().split())) for i in range(M)]

d = [-1]*N


def find(x):
    if d[x] < 0:
        return x
    d[x] = find(d[x])
    return d[x]


def union(x, y):
    x, y = find(x), find(y)
    if x == y:
        return
    if (d[x] > d[y]):
        x, y = y, x
    d[x] += d[y]
    d[y] = x


for f in F:
    union(f[0]-1, f[1]-1)
print(-min(d))