Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

l = []
r = []
for i in range(k):
  a, b = map(int, input().split())
  l.append(a)
  r.append(b)

mod = 998244353

dp = [0] * (n + 1)
#１マス目の行き方は１通り
dp[1] = 1
dpsum = [0] * (n + 1)
dpsum[1] = 1
for i in range(2, n + 1):
  for j in range(k):
    li = i - r[j]
    ri = i - l[j]
    if ri < 0:
      continue
    li = max(1, li)

    dp[i] += dpsum[ri] - dpsum[li - 1]
  
  dpsum[i] = dpsum[i - 1] + dp[i]

print(dp[n] % mod)



Fixed submission:
n, k = map(int, input().split())

l = []
r = []
for i in range(k):
  a, b = map(int, input().split())
  l.append(a)
  r.append(b)

mod = 998244353

dp = [0] * (n + 1)
#１マス目の行き方は１通り
dp[1] = 1
dpsum = [0] * (n + 1)
dpsum[1] = 1
for i in range(2, n + 1):
  for j in range(k):
    li = i - r[j]
    ri = i - l[j]
    if ri < 0:
      continue
    li = max(1, li)

    dp[i] += (dpsum[ri] - dpsum[li - 1]) % mod
  
  dpsum[i] = dpsum[i - 1] + dp[i]

print(dp[n] % mod)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

ans = [0] * (N)
temp = [0] * (N)
temp[0] = A[0]

for i in range(1, N):
  temp[i] = temp[i - 1] * A[i]

ans[0] = A[0]
for i in range(N):
  ans[i] = temp[i]
  if i >= K:
    ans[i] /= temp[i - K]

for i in range(K, N):
  if ans[i] > ans[i - 1]:
    print('Yes')
  else:
    print('No')


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



for i in range(K, N):
  if A[i] > A[i - K]:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
a.sort()

div = [True] * (max(a) + 1)
used = defaultdict(int)
for n in a:
    if used[n] > 0:
        div[n] = False
        continue
    used[n] += 1
    if not div[n]:
        continue
    i = 2
    while n * i <= max(a):
        div[n * i] = False
        i += 1

ans = 0
for x in a:
    if div[x]:
        ans += 1

print(ans)

Fixed submission:
import math
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
maxi = max(a)
a.sort()

div = [0] * (maxi + 1)
for n in a:
    div[n] += 1
    if div[n] == 1:
        for j in range(n*2, maxi + 1, n):
            div[j] += 100
print(div.count(1))

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
    no_div = True
    for j in range(n):
        if i == j:
            continue
        if a[i] < a[j]:
            break
        if a[i] % a[j] == 0:
            no_div = False
            break
    if no_div:
        ans += 1

print(ans)

Fixed submission:
import math
from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
maxi = max(a)
a.sort()

div = [0] * (maxi + 1)
for n in a:
    div[n] += 1
    if div[n] == 1:
        for j in range(n*2, maxi + 1, n):
            div[j] += 100
print(div.count(1))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1
INF = 10 ** 18
for n in a:
    ans *= n

if ans > INF:
    ans = -1

print(ans)


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

INF = 10 ** 18
ans = 1
if any([n == 0 for n in a]):
    print(0)
    exit()

for n in a:
    ans *= n
    if ans > INF:
        ans = -1
        break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import itertools
N = int(input())
A = list(map(int, input().split()))

def choose2(n):
    return len(list(itertools.combinations(range(n), 2)))

counts = Counter(A)
total = 0
for n, count in counts.items(): 
    #初めに、同じ数同士から2つ選んだ時の組み合わせの総和を求める
    combi = choose2(count)
    total += combi 

for i in A:
    #上で求めた組み合わせの総和から、消える数字について1つ減らしたときの組み合わせを減らす
    temp = total - choose2(counts[i])
    temp += choose2(counts[i] - 1) 
    print(temp)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

def choose2(n):
    return n * (n - 1) // 2

counts = Counter(A)
total = 0
for n, count in counts.items(): 
    #初めに、同じ数同士から2つ選んだ時の組み合わせの総和を求める
    combi = choose2(count)
    total += combi 

for i in A:
    #上で求めた組み合わせの総和から、消える数字について1つ減らしたときの組み合わせを減らす
    temp = total - choose2(counts[i])
    temp += choose2(counts[i] - 1) 
    print(temp)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import itertools
N = int(input())
A = list(map(int, input().split()))

def choose2(n):
    return len(list(itertools.combinations(range(n), 2)))

counts = Counter(A)
total = 0
combi_count = [-1] * (N + 1)
for n, count in counts.items(): 
    #初めに、同じ数同士から2つ選んだ時の組み合わせの総和を求める
    combi = choose2(count)
    total += combi 
    combi_count[n] = combi

for i in A:
    #上で求めた組み合わせの総和から、消える数字について1つ減らしたときの組み合わせを減らす
    temp = total - combi_count[i]
    temp += choose2(counts[i] - 1) 
    print(temp)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

def choose2(n):
    return n * (n - 1) // 2

counts = Counter(A)
total = 0
for n, count in counts.items(): 
    #初めに、同じ数同士から2つ選んだ時の組み合わせの総和を求める
    combi = choose2(count)
    total += combi 

for i in A:
    #上で求めた組み合わせの総和から、消える数字について1つ減らしたときの組み合わせを減らす
    temp = total - choose2(counts[i])
    temp += choose2(counts[i] - 1) 
    print(temp)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import itertools
N = int(input())
A = list(map(int, input().split()))

counts = Counter(A)

for i in A:
    ans = 0
    for n, count in counts.items():
        temp = count
        if n == i:
            temp -= 1
        if temp < 2:
            continue
        ans += len(list(itertools.combinations(range(temp), 2)))
    print(ans)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

def choose2(n):
    return n * (n - 1) // 2

counts = Counter(A)
total = 0
for n, count in counts.items(): 
    #初めに、同じ数同士から2つ選んだ時の組み合わせの総和を求める
    combi = choose2(count)
    total += combi 

for i in A:
    #上で求めた組み合わせの総和から、消える数字について1つ減らしたときの組み合わせを減らす
    temp = total - choose2(counts[i])
    temp += choose2(counts[i] - 1) 
    print(temp)
Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int, input().split())

mod = 10 ** 9 + 7
#a本、b本の制限を無視すると、2^n - 1の選び方が存在する。
ans = pow(2, n, mod) - 1 % mod

def choose(n, a):
    x = y = 1
    for i in range(a):
        y *= (i + 1) % mod
        x *= (n - i) % mod
    return x * pow(y, mod - 2, mod) % mod 
#上記で求めた値から、a本を選んだ時とb本を選んだ時の組み合わせ数を引く
ans -= choose(n, a)
ans -= choose(n, b)

print(ans % mod)

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

mod = 10 ** 9 + 7
#a本、b本の制限を無視すると、2^n - 1の選び方が存在する。
ans = pow(2, n, mod) - 1 

def choose(n, a):
    x, y = 1, 1
    for i in range(a):
        y = y * (i + 1) % mod
        x = x * (n - i) % mod
    return x * pow(y, mod - 2, mod) % mod 
#上記で求めた値から、a本を選んだ時とb本を選んだ時の組み合わせ数を引く
ans -= choose(n, a)
ans -= choose(n, b)

print(ans % mod)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))

#連続するK個の要素の和で一番大きいもの
start = -1
maximum = -1
for i in range(len(p) - k + 1):
  temp = sum(p[i:i + k])
  if temp > maximum:
    maximum = temp
    start = i

#期待値の算出
exp = 0
for i in range(start, start + k):
  temp = 1 / 2 * p[i] * (p[i] + 1)
  exp += temp / p[i]

print(exp)




Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

#累積和を出す
t = [0] * (len(p) + 1)
for i in range(len(p)):
  t[i + 1] = t[i] + p[i]

#連続するK個の和で、最大の値を取得する。
maximum = -1
start = -1

for i in range(len(p) - k + 1):
  temp = t[i + k] - t[i]
  if temp > maximum:
    maximum = temp
    start = i

#期待値
exp = 0
for i in range(start, start + k):
  temp = 1 / 2 * p[i] * (p[i] + 1)
  exp += temp / p[i]

print(exp)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))

#連続するK個の要素の和で一番大きいもの
start = -1
maximum = -1
for i in range(len(p) - k + 1):
  temp = sum(p[i:i + k])
  if temp > maximum:
    maximum = temp
    start = i

#期待値の算出
exp = 0
for i in range(start, start + k):
  temp = 0
  for j in range(1, p[i] + 1):
    temp += j
  exp += temp / p[i]

print(exp)



Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))

#累積和を出す
t = [0] * (len(p) + 1)
for i in range(len(p)):
  t[i + 1] = t[i] + p[i]

#連続するK個の和で、最大の値を取得する。
maximum = -1
start = -1

for i in range(len(p) - k + 1):
  temp = t[i + k] - t[i]
  if temp > maximum:
    maximum = temp
    start = i

#期待値
exp = 0
for i in range(start, start + k):
  temp = 1 / 2 * p[i] * (p[i] + 1)
  exp += temp / p[i]

print(exp)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input()))
if a[0] == a[1]:
  print("Yes")
else:
  print("No")

Fixed submission:
a = list(map(int, input().split()))
if a[0] == a[1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
arr = list(map(int, input().split()))
count = 0
for i in range(1, N + 1):
  flg = True
  for j in range(i):
    if arr[i - 1] > arr[j]:
      flg = False
      break
  if flg:
    count += 1

print(count)

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

mi = 10000000
count = 0
for i in range(N):
  if a[i] <= mi:
    mi = a[i]
  if a[i] == mi:
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input().split())

n = k * 500

if n => x:
  print('Yes')
else:
  print('No')

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

n = k * 500

if n >= x:
  print('Yes')
else:
  print('No')

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

n = k * 500

if n = > x:
  print('Yes')
else:
  print('No')

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

n = k * 500

if n >= x:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a = [input() for i in range(3)]

N = int(a[0])
S = a[1]
T = a[2]

answer = ""

for i in range(N):
  answer += S[i]
  answer += T[i]
 
print(answer)

Fixed submission:
N = int(input()) 
a = input().split()
S = a[0]
T = a[1]

answer = ""

for i in range(N):
  answer += S[i]
  answer += T[i]
 
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

ans = set()
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            ans.add(S[i] + S[j] + S[k])

print(len(ans))


Fixed submission:
N = int(input())
S = input()

ans = set()
for i in range(10):
    i_index = S.find(str(i))
    if i_index == -1:
        continue
    for j in range(10):
        j_index = S.find(str(j), i_index+1)
        if j_index == -1:
            continue
        for k in range(10):
            k_index = S.find(str(k), j_index+1)
            if k_index == -1:
                continue
            ans.add("{}{}{}".format(i, j, k))

print(len(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1, N):
    ans += i
print(ans)

Fixed submission:
N = int(input())
n = N - 1

ans = n * (n + 1) // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]


for i in range(n):
  l = list(a)
  del l[i] 
  print(max(l))

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

b = list(a)
a.sort()

for i in range(n):
  if b[i] == a[n - 1]:
    print(a[n - 2])
  else:
    print(a[n - 1])
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())

ans = 1000000000
for i in range(l, r):
  for j in range(i + 1, r + 1):
    ans = min((i * j) % 2019, ans)
    #割り切れた場合はそれが最小値なので探索終了とする
    if ans == 0:
      break

print(ans)

Fixed submission:
l, r = map(int, input().split())
r = min(r, l + 4038)
ans = 2018
for i in range(l, r):
  for j in range(i + 1, r + 1):
    ans = min((i * j) % 2019, ans)
    #割り切れた場合はそれが最小値なので探索終了とする
    if ans == 0:
      break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())

ans = 1000000000
for i in range(l, r):
  for j in range(i + 1, r + 1):
    ans = min((i * j) % 2019, ans)

print(ans)

Fixed submission:
l, r = map(int, input().split())
r = min(r, l + 4038)
ans = 2018
for i in range(l, r):
  for j in range(i + 1, r + 1):
    ans = min((i * j) % 2019, ans)
    #割り切れた場合はそれが最小値なので探索終了とする
    if ans == 0:
      break

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

#B以下の整数の個数
x = B - (B // C) - (B // D)
#C,Dの最大公約数を求める
l = math.gcd(C, D)
#C,Dの最小公倍数を求める
temp = C * D // l 
#C,Dで重複して引いた数を足し合わせる
x += (B // temp)

#同様にA - 1以下の整数のうちの個数も求める
a = A - 1
y = a - (a // C) - (a // D)
y += (a // temp)

ans = x - y
print(ans)

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

#B以下の整数の個数
x = B - (B // C) - (B // D)
#C,Dの最大公約数を求める
l = fractions.gcd(C, D)
#C,Dの最小公倍数を求める
temp = C * D // l 
#C,Dで重複して引いた数を足し合わせる
x += (B // temp)

#同様にA - 1以下の整数のうちの個数も求める
a = A - 1
y = a - (a // C) - (a // D)
y += (a // temp)

ans = x - y
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

#B以下の整数の個数
x = B - (B // C) - (B // D)
#C,Dの最大公約数を求める
l = math.gcd(C, D)
#C,Dの最小公倍数を求める
temp = C * D // l 
#C,Dで重複して引いた数を足し合わせる
x += (B // temp)

#同様にA - 1以下の整数のうちの個数も求める
a = A - 1
y = a - (a // C) - (a // D)
y += (a // temp)

ans = x - y
print(ans)

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

#B以下の整数の個数
x = B - (B // C) - (B // D)
#C,Dの最大公約数を求める
l = fractions.gcd(C, D)
#C,Dの最小公倍数を求める
temp = C * D // l 
#C,Dで重複して引いた数を足し合わせる
x += (B // temp)

#同様にA - 1以下の整数のうちの個数も求める
a = A - 1
y = a - (a // C) - (a // D)
y += (a // temp)

ans = x - y
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

ans = 0
for i in range(3001):
  for j in range(3001):
    v = i * R + j * G
    if N >= v and (N - v) % B == 0:
      ans += 1

print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(N // R + 1):
  for j in range((N - i * R) // G + 1):
    ball = i * R + j * G
    if N == ball:
      ans += 1
    elif (N - ball) % B == 0:
      ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
r, g, b, n = map(int, input().split())

ans = 0
for i in range(n // r + 1):
  for j in range(n // g + 1):
    t = i * r + j * g
    if t > n:
      continue
    if n - t == 0:
      ans += 1
    elif (n - t) % b == 0:
      ans += 1

print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(N // R + 1):
  for j in range((N - i * R) // G + 1):
    ball = i * R + j * G
    if N == ball:
      ans += 1
    elif (N - ball) % B == 0:
      ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int,input().split())
s = input()

x = []
for i in range(q):
  x.append(list(map(int, input().split())))

for i in x:
  print(s[i[0] - 1:i[1]].count('AC'))

Fixed submission:
n, q = map(int,input().split())
s = input()


a = [0] * (n + 1)

# n文字目までにACが出た回数を累積和で求める
for i in range(n):
  a[i + 1] = a[i] + (1 if s[i:i + 2] == 'AC' else 0)

for i in range(q):
  l, r = map(int, input().split())
  print(a[r - 1] - a[l - 1])
Buggy python submission (verdict: Runtime Error):
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]
t.sort()
def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
ans = lcm(t[0], t[1])
for i in range(2, n):
  ans = lcm(ans, t[i])

print(ans)

Fixed submission:
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
if n == 1:
  print(t[0])
else:
  ans = lcm(t[0], t[1])
  for i in range(2, n):
    ans = lcm(ans, t[i])
  print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]

def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
ans = lcm(t[0], t[1])
for i in range(2, n):
  ans = lcm(ans, t[i])

print(ans)

Fixed submission:
import fractions 
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

#入力tについて、最小公倍数を求めればそれが答えとなる
if n == 1:
  print(t[0])
else:
  ans = lcm(t[0], t[1])
  for i in range(2, n):
    ans = lcm(ans, t[i])
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
  if i % 2 == 0:
    b.append(a[i])
  else:
    b = [a[i]] + b

if n % 2 == 0:
  for i in b:
    print(i)
else:
  for i in range(len(b) - 1, -1, -1):
    print(b[i])

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

b = [-1] * (n + 2)

mid = n // 2
left = mid - 1
right = mid + 1

b[mid] = a[0]

for i in range(1, n):
  if not i % 2 == n % 2:
    b[left] = a[i]
    left -= 1
  else:
    b[right] = a[i]
    right += 1

for i in b:
  if i < 0:
    continue
  print(i, end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

arr = []
for i in range(n):
  a = list(map(int, input().split()))
  for j in range(a[1]):
    arr.append(a[0])
  
arr.sort()
print(arr[k - 1])

Fixed submission:
n, k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]

ab.sort(key=lambda x: x[0])
index = 0
for i in range(n):
  index += ab[i][1]
  if index >= k:
    ans = ab[i][0]
    break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

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

print(p % 1000000007)

Fixed submission:
n = int(input())

mod = 1000000007

p = 1
for i in range(n):
  p = p * (i + 1) % mod

print(p % mod)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())

ans = 0
for x in range(K + 1):
    for y in range(K + 1):
        if x + y > S:
            break
        z = S - (x + y)
        if z > K:
            continue
        if x + y + z == S:
            ans += 1

print(ans)

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

ans = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - (x + y)
        if 0 <= z <= K:
            ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C = map(int, input().split())
K = int(input())

while K > 0:
    if B < A:
        B *= 2
        K -= 1
    elif C < B:
        C *= 2
        K -= 1
    
    if B > A and C > B:
        break

if B > A and C > B:
    print("Yes")
else:
    print("No")

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

for i in range(K):
    if B <= A:
        B *= 2
    elif C <= B:
        C *= 2

if B > A and C > B:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C = map(int, input().split())
K = int(input())

while K > 0:
    if B < A:
        B *= 2
        K -= 1
    elif C < B:
        C *= 2
        K -= 1

if B > A and C > B:
    print("Yes")
else:
    print("No")

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

for i in range(K):
    if B <= A:
        B *= 2
    elif C <= B:
        C *= 2

if B > A and C > B:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int, input().split()))

A.sort()
if A[0] == A[1]:
    cnt = N-1
else:
    cnt = N

for i in range(1, N):
    for j in range(i):
        if A[i] % A[j] == 0:
            cnt -= 1
            break

print(cnt)
        


Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

A.sort()
max_num = A[-1]
counter = Counter(A)
s = set()
cnt = 0
for a in A:
    if a in s:
        continue
    if counter[a] == 1:
        cnt += 1
    idx = 1
    while a * idx <= max_num:
        s.add(a * idx)
        idx += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
X = int(input())

tmp = 100
cnt = 
while tmp < X:
    tmp = tmp + int(tmp*0.01)
    cnt += 1

print(cnt)



Fixed submission:
X = int(input())

tmp = 100
cnt = 0
while tmp < X:
    tmp = tmp + int(tmp*0.01)
    cnt += 1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())

current_n = N
b_cnt = 0
flag = True
while current_n != 0:
    if flag:
        if current_n - A > 0:
            current_n = current_n - A
            b_cnt += A
        else:
            b_cnt += current_n
            current_n = 0
        flag = False
    else:
        if current_n - B > 0:
            current_n = current_n - B
        else:
            current_n = 0
        flag = True

print(b_cnt)


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

q, r = divmod(N, A+B)

if r >= A:
    print(q*A+A)
else:
    print(q*A+r)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name not in names:
        words[name] = 1
        names.append(name)
    elif name in names:
        words[name] += 1

max_num = max(words.values())
max_name_list = [word[0] for word in words.items() if word[1] == max_num]

max_name_list = sorted(max_name_list)

for i in range(len(max_name_list)):
    print(max_name_list[i])


Fixed submission:
from collections import Counter
N = int(input())

counter = Counter()
for i in range(N):
    s = input()
    counter[s] += 1


lst = list(counter.most_common())
max_num = lst[0][1]

for l in sorted(lst):
    if l[1] == max_num:
        print(l[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name not in names:
        words[name] = 1
        names.append(name)
    elif name in names:
        words[name] += 1

max_name_list = [word[0] for word in words.items() if word[1] == max(words.values())]

max_name_list = sorted(max_name_list)

for i in range(len(max_name_list)):
    print(max_name_list[i])


Fixed submission:
from collections import Counter
N = int(input())

counter = Counter()
for i in range(N):
    s = input()
    counter[s] += 1


lst = list(counter.most_common())
max_num = lst[0][1]

for l in sorted(lst):
    if l[1] == max_num:
        print(l[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name not in names:
        words[name] = 1
        names.append(name)
    elif name in names:
        words[name] += 1

max_name_list = []
max_num = max(words.values());
for nm in words.items():
    if nm[1] == max_num:
        max_name_list.append(nm[0])

max_name_list = sorted(max_name_list)
for i in range(len(max_name_list)):
    print(max_name_list[i])


Fixed submission:
from collections import Counter
N = int(input())

counter = Counter()
for i in range(N):
    s = input()
    counter[s] += 1


lst = list(counter.most_common())
max_num = lst[0][1]

for l in sorted(lst):
    if l[1] == max_num:
        print(l[0])
Buggy python submission (verdict: Time Limit Exceeded):
H, N = map(int, input().split())

attack_list = []
mp_list = []
for i in range(N):
    a, m = map(int, input().split())
    attack_list.append(a)
    mp_list.append(m)

inf = float('inf')
max_hp = H+max(attack_list)
dp = [inf for i in range(max_hp)]
dp[0] = 0

for i in range(H):
    for j in range(N):
        next_i = i + attack_list[j]
        dp[next_i] = min(dp[next_i], dp[i] + mp_list[j])

print(min(dp[H:max_hp+1]))


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

attack_list = []
mp_list = []
for i in range(N):
    a, m = map(int, input().split())
    attack_list.append(a)
    mp_list.append(m)

inf = float('inf')
max_hp = H+max(attack_list)
dp = [inf for i in range(max_hp)]
dp[0] = 0

for i in range(H):
    for j in range(N):
        next_i = i + attack_list[j]
        dp[next_i] = min(dp[next_i], dp[i] + mp_list[j])

print(min(dp[H:max_hp+1]))