Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
tmp = [0] * N
count = 0
keys = [i for i in range(N)]
bulb_to_check = {key: 0 for key in keys}

for t in range(K):
    if not bulb_to_check:
        break
    for i in bulb_to_check:  # i番目の電球の明るさを決定する
        if A[i] == N:
            del bulb_to_check[i]  # 最大値に達した電球を対象から除く
        else:
            for j in range(N):  # 各電球jが、電球iを照らしているかを確認する
                if j - A[j] - 0.5 <= i <= j + A[j] + 0.5:
                    count += 1
            tmp[i] = count
        count = 0
    for l in range(N):
        A[l] = tmp[l]

print(*A)


Fixed submission:
S = input()
print(S[0:3])
Buggy python submission (verdict: Runtime Error):
A, B = input().split()


A = int(A)
x = int(B[0]) * 100
y = int(B[1]) * 10
z = int(B[2]) * 1

C = x + y + z

print((A * C) // 100)


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

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

product = 1

for i in range(N):
    product *= A[i]

if product > 1000000000000000000:
    print(-1)
else:
    print(product)


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

product = 1
flag = 0

if 0 in A:
    print(0)
else:
    for i in range(N):
        product *= A[i]
        if product > 1000000000000000000:
            flag += 1
            break
    if flag == 0:
        print(product)
    else:
        print(-1)
Buggy python submission (verdict: Runtime Error):
from Decimal import decimal

A, B = map(decimal, input().split())
print(A * B)

Fixed submission:
from decimal import Decimal

A, B = map(Decimal, input().split())

print(int(A * B))
Buggy python submission (verdict: Time Limit Exceeded):
import math

A, B, N = map(int, input().split())
mx = 0
p = N
q = B

if B <= N:
    mx = math.floor(A / B * q) - math.floor(q / B) * A
    while mx == 0:
        q -= int(B / 20)
else:
    mx = math.floor(A / B * p) - math.floor(p / B) * A
    while mx == 0:
        p -= int(N / 20)

print(mx)

Fixed submission:
import math

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

if N >= B-1:  # x = B-1のときに最大値
    beta = (B-1)/B
    print(math.floor(A * beta))

else:
    beta = N/B
    print(math.floor(A * beta))

Buggy python submission (verdict: Time Limit Exceeded):
import math

A, B, N = map(int, input().split())
mx = 0
p = N
q = B

if B <= N:
    mx = math.floor(A / B * q) - math.floor(q / B) * A
    while mx == 0:
        q -= int(B / 20)
else:
    mx = math.floor(A / B * p) - math.floor(p / B) * A
    while mx == 0:
        p -= int(N / 20)

print(mx)

# for x in range(1, 35):
#     print(math.floor(9 /23 * x) - math.floor(x / 23) * 9)

Fixed submission:
import math

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

if N >= B-1:  # x = B-1のときに最大値
    beta = (B-1)/B
    print(math.floor(A * beta))

else:
    beta = N/B
    print(math.floor(A * beta))

Buggy python submission (verdict: Time Limit Exceeded):
import math

A, B, N = map(int, input().split())
mx = 0
p = N
q = B

if B <= N:
    mx = math.floor(A / B * q) - math.floor(q / B) * A
    while mx == 0:
        q -= 1
else:
    mx = math.floor(A / B * p) - math.floor(p / B) * A
    while mx == 0:
        p -= 1

print(mx)

Fixed submission:
import math

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

if N >= B-1:  # x = B-1のときに最大値
    beta = (B-1)/B
    print(math.floor(A * beta))

else:
    beta = N/B
    print(math.floor(A * beta))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
prize = []
for i in range(N):
    s = str(input())
    if s in prize:
        continue
    else:
        prize.append(s)

print(len(prize))


Fixed submission:
N = int(input())
prize = {}

for i in range(N):
    s = str(input())
    if s in prize:
        continue
    else:
        prize[s] = 1

print(len(prize))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
dic = {}
ans = {}
more_than_two = []

for num in A:
    if num in dic:
        dic[num] += 1
        if num not in more_than_two:
            more_than_two.append(num)
    else:
        dic[num] = 1

for num in A:
    if num in ans:
        print(ans[num])
    else:
        dic[num] -= 1
        total = 0
        for a in more_than_two:
            total += dic[a] * (dic[a]-1) / 2
        ans[num] = int(total)
        print(int(total))
        dic[num] += 1


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

for num in A:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1

total = 0
for value in dic.values():
    total += value * (value-1) / 2   # 使えないボールがない場合のtotal

for num in A:
    print(int(total - dic[num] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
dic = {}
ans = {}

for num in A:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1

for num in A:
    if num in ans:
        print(ans[num])
    else:
        dic[num] -= 1
        total = 0
        for value in dic.values():
            total += value * (value-1) / 2
        ans[num] = int(total)
        print(int(total))
        dic[num] += 1


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

for num in A:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1

total = 0
for value in dic.values():
    total += value * (value-1) / 2   # 使えないボールがない場合のtotal

for num in A:
    print(int(total - dic[num] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
dic = {}

for num in A:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1

for num in A:
    dic[num] -= 1
    total = 0
    for value in dic.values():
        total += value * (value-1) / 2
    print(int(total))
    dic[num] += 1


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

for num in A:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1

total = 0
for value in dic.values():
    total += value * (value-1) / 2   # 使えないボールがない場合のtotal

for num in A:
    print(int(total - dic[num] + 1))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
dic = {}

for i in range(N):
    temp = input()
    if temp in dic:
        dic[temp] += 1
    else:
        dic[temp] = 1

max_kv_list = [kv[0] for kv in dic.items() if kv[1] == max(dic.values())]

max_kv_list.sort()

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


Fixed submission:
N = int(input())
dic = {}
max_v = 0

for i in range(N):
    temp = input()
    if temp in dic:
        dic[temp] += 1
    else:
        dic[temp] = 1
    max_v = max(max_v, dic[temp])

keys = sorted(dic.keys())
for k in keys:
    if dic[k] == max_v:
        print(k)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
e = 0
max_e = 0

for i in range(0, N-K+1):
    e = 0
    if i > 0:
        if P[i-1] >= P[i+K-1]:
            continue
    for j in range(i, i+K):
        e += (P[j] + 1) / 2
    max_e = max(e, max_e)

print(max_e)


Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
S = []

for num in P:
    S.append((num + 1) / 2)

ans = sum(S[0:K])
max_ans = ans

for i in range(N-K):
    ans = ans - S[i] + S[i+K]
    max_ans = max(ans, max_ans)

print(max_ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
e = 0
max_e = 0

for i in range(0, N-K+1):
    e = 0
    for j in range(i, i+K):
        e += (P[j] + 1) / 2
    max_e = max(e, max_e)

print(max_e)


Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
S = []

for num in P:
    S.append((num + 1) / 2)

ans = sum(S[0:K])
max_ans = ans

for i in range(N-K):
    ans = ans - S[i] + S[i+K]
    max_ans = max(ans, max_ans)

print(max_ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
H = list(map(int, input().split()))

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[H.index(max(H))]
    print(sum(H))


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

if K >= N:
    print(0)

else:
    H.sort(reverse=True)
    print(sum(H[K:]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = {i: 0 for i in range(100)}
for i in range(1, N+1):
    if i % 10 != 0:
        s = str(i)
        D[int(s[0])*10+int(s[-1])] += 1
S = 0
for i in range(10):
    for j in range(10):
        S += D[i*10+j] * D[j*10+i]
print(S)


Fixed submission:
N, M = map(int, input().split())
if N == M:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
K, X = map(int, input().split())
wealth = 500 * K
if K >= X:
  print('Yes")
else:
  print('No')

Fixed submission:
K, X = map(int, input().split())
wealth = 500 * K
if wealth >= X:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
K, X = int(input())
wealth = 500 * K
if K >= X:
  print('Yes")
else:
  print('No')

Fixed submission:
K, X = map(int, input().split())
wealth = 500 * K
if wealth >= X:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

length = len(A)
head = 0
i = 1

while True:
    if i in A:
        head = A.index(i)
        A = A[head:]
        i += 1
    else:
        break

if i == 1:
    print(-1)
else:
    print(length - i + 1)


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

length = len(A)
find_next = 1

for i in range(N):
    if A[i] == find_next:
        find_next += 1

if find_next == 1:
    print(-1)
else:
    print(length - find_next + 1)

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


head = 0
i = 1

while True:
    if i in A[head:]:
        head = A[head:].index(i)
        i += 1
    else:
        break

if i == 1:
    print(-1)
else:
    print(len(A) - i + 1)


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

length = len(A)
find_next = 1

for i in range(N):
    if A[i] == find_next:
        find_next += 1

if find_next == 1:
    print(-1)
else:
    print(length - find_next + 1)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
P = 10 ** 9 + 7
N = (X+Y) // 3
R = (2 * X -Y) // 3
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]

for i in range(2, N+1):
    fact.append((fact[-1] * i) % P)
    inv.append((-inv[P % i] * (P//i) % P))
    factinv.append((factinv[-1] * inv[-1] % P))


def cmb_mod(n, r, p):
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % p


if (X+Y) % 3 != 0:
    print(0)
else:
    print(cmb_mod(N, R, P))


Fixed submission:
X, Y = map(int, input().split())
P = 10 ** 9 + 7
N = (X+Y) // 3
R = (2 * X - Y) // 3
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]

for i in range(2, N+1):
    fact.append((fact[-1] * i) % P)
    inv.append((-inv[P % i] * (P//i) % P))
    factinv.append((factinv[-1] * inv[-1] % P))


def cmb_mod(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n-r)
    return fact[n] * factinv[r] * factinv[n-r] % p


if (X+Y) % 3 != 0:
    print(0)
else:
    print(cmb_mod(N, R, P))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
height = list(map(int, input().split()))
unqualified = 0

for height in heights:
    if height < K:
        unqualified += 1

print(unqualified)


Fixed submission:
N, K = map(int, input().split())
heights = list(map(int, input().split()))
qualified = 0

for height in heights:
    if height >= K:
        qualified += 1

print(qualified)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
prices = list(map(int, input().split()))

for i in range(M):
    max_idx = prices.index(max(prices))
    prices[max_idx] = prices[max_idx] // 2

print(sum(prices))


Fixed submission:
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x * (-1), A))
heapq.heapify(A)

for _ in range(M):
    tmp = heapq.heappop(A) * (-1)
    tmp //= 2
    heapq.heappush(A, tmp * (-1))

print(-sum(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N * (N-1) // 2)


Fixed submission:
S = input()
T = input()
count = 0

for i in range(3):
    if S[i] == T[i]:
        count += 1
        
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
R = []

'''A1だけ別個で計算する'''
tmp = 0
for j in range(0, N, 2):
    tmp += A[j]
for k in range(1, N, 2):
    tmp -= A[k]
R.append(tmp)

'''A2~AN'''
for i in range(1, N):
    tmp = 0
    pm = -1
    for j in range(i-1-N, -N-1, -1):  # A[i-1]より手前側
        pm *= -1
        tmp += A[j] * pm
    pm = -1
    for k in range(i, N):  # A[i]より後ろ側
        pm *= -1
        tmp += A[k] * pm
    R.append(tmp)

print(*R)


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

'''プラススタート、マイナススタートの累積和を取る'''
plus_start = []
minus_start = []
'''後ろからの累積和'''
plus_start_rev = []
minus_start_rev = []

tmp = 0
pm = -1
for i in range(N):
    pm *= -1
    tmp += A[i] * pm
    plus_start.append(tmp)
tmp = 0
pm = -1
for i in range(-1, -N-1, -1):
    pm *= -1
    tmp += A[i] * pm
    plus_start_rev.append(tmp)

tmp = 0
pm = 1
for i in range(N):
    pm *= -1
    tmp += A[i] * pm
    minus_start.append(tmp)

tmp = 0
pm = 1
for i in range(-1, -N-1, -1):
    pm *= -1
    tmp += A[i] * pm
    minus_start_rev.append(tmp)

'''各山の降水量を計算する'''
for i in range(N):
    if i == 0:
        tmp = plus_start[-1]
        R.append(tmp)
        continue
    if i % 2 == 0:
        tmp = minus_start[i-1] + plus_start_rev[N-i-1]
    else:
        tmp = plus_start[i-1] + minus_start_rev[N-i-1]
    R.append(tmp)

print(*R)
Buggy python submission (verdict: Runtime Error):
S = int(input())
flag = 0

for i in range(3):
    if S[i] == S[i+1]:
        flag += 1

if flag:
    print('Bad')
else:
    print('Good')


Fixed submission:
S = input()
flag = 0

for i in range(3):
    if S[i] == S[i+1]:
        flag += 1

if flag:
    print('Bad')
else:
    print('Good')
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))

coordinate = 0
count = 1

while True:
    coordinate += L[count-1]
    if coordinate > X:
        break
    else:
        count += 1

print(count)


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

coordinate = 0
count = 0

while count < N:
    coordinate += L[count]
    if coordinate > X:
        break
    else:
        count += 1

print(count+1)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[1] = 1
dp[2] = 2

if 1 in skip:
    dp[1] = 0
    dp[2] = 1
if 2 in skip:
    dp[2] = 0

for i in range(3, N+1):
    if i in skip:
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])


Fixed submission:
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[0] = 1
if 1 not in skip:
    dp[1] = 1

for i in range(2, N+1):
    if i in skip:
        continue
    dp[i] += (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])

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

N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[1] = 1
dp[2] = 2

if 1 in skip:
    dp[1] = 0
    dp[2] = 1
if 2 in skip:
    dp[2] = 0
if N in skip:
    print(0)
    sys.exit()

for i in range(3, N+1):
    if i in skip:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])


Fixed submission:
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[0] = 1
if 1 not in skip:
    dp[1] = 1

for i in range(2, N+1):
    if i in skip:
        continue
    dp[i] += (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[1] = 1
dp[2] = 2

if 1 in skip:
    dp[1] = 0
    dp[2] = 1
if 2 in skip:
    dp[2] = 0

for i in range(3, N+1):
    if i in skip:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])


Fixed submission:
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[0] = 1
if 1 not in skip:
    dp[1] = 1

for i in range(2, N+1):
    if i in skip:
        continue
    dp[i] += (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = []

for _ in range(M):
    skip.append(int(input()))

dp[1] = 1
dp[2] = 2

if 1 in skip:
    dp[1] = 0
    dp[2] = 1
if 2 in skip:
    dp[2] = 0

for i in range(3, N+1):
    if i in skip:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])


Fixed submission:
N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[0] = 1
if 1 not in skip:
    dp[1] = 1

for i in range(2, N+1):
    if i in skip:
        continue
    dp[i] += (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])
Buggy python submission (verdict: Runtime Error):
l = input().split()
if l[1] = "+":
  print(int(l[0])+int(l[2]))
else:
  print(int(l[0])-int(l[2]))

Fixed submission:
l = input().split()
if l[1] == "+":
  print(int(l[0])+int(l[2]))
else:
  print(int(l[0])-int(l[2]))
Buggy python submission (verdict: Runtime Error):
list1 = input().split()
n = int(list1[0])
t = int(list1[1])
a = input().split()

list = []
l = 0
i = 0
while l < n:
   i = l + 1
   if i == n:
       list.append(int(a[i-1])-int(a[l]))     
       break
      else: 
       while i < n:
        if a[i-1]<a[i]:
           i += 1
        else:
           list.append(int(a[i-1])-int(a[l]))
           break
   l += 1

print(list.count(max(list)))

Fixed submission:
list = input().split()
a = int(list[0])
b = int(list[1])
c = int(list[2])

if a+b == c:
   print("Yes")
elif a+c == b:
   print("Yes")
elif b+c == a:
   print("Yes")
else:
   print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(input())
t = str(input())
i = 0
while t.find(s[i,n])>-1:



Fixed submission:
n = int(input())
s = str(input())
t = str(input())
i = -1
while True:
   i += 1
   if t.find(s[i:n])>-1:
      print(int(n+i))
      break
Buggy python submission (verdict: Runtime Error):
list = str(input()).split()
if int(list[0]) = int(list[1]):
   if int(list[1]) = int(list[2]):
      print(1)
   else print(2)
elif int(list[0]) = int(list[2]):
   print(2)
elif int(list[1]) = int(list[2]):
   print(2)
else:
   print(3)

Fixed submission:
list = str(input()).split()
if int(list[0]) == int(list[1]):
   if int(list[1]) == int(list[2]):
      print(1)
   else :
      print(2)
elif int(list[0]) == int(list[2]):
   print(2)
elif int(list[1]) == int(list[2]):
   print(2)
else:
   print(3)
Buggy python submission (verdict: Runtime Error):
list = input().split()
a = bin(int(list[0])-1)
b = int(list[1])-1
print(pow(b,a)*int(list[1]))

Fixed submission:
list = input().split()
a = (int(list[0])-1)
b = int(list[1])-1
print(pow(b,a)*int(list[1]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 0
list = []
while i < n:
   list.append(input().split())
   i += 1
h = 1
li = list[0]
thh = int(li[0])
ahh = int(li[1])
while h < n:
     listh = list[h]
     listhh = list[h-1]
     th = int(listh[0])
     ah = int(listh[1])
     l = 1
     m = 1
     while l*th < thh:
        l += 1
     while m*ah < ahh:
        m += 1
     a = max(l,m)
     thh = th*a
     ahh = ah*a
     h += 1
print(thh+ahh)

Fixed submission:
from decimal import Decimal
n = int(input())
i = 0
list = []
while i < n:
   list.append(input().split())
   i += 1
h = 0
th = 1.0
ah = 1.0

def f1(a,b):
     if a%b == 0:
          return a/b
     else:
          return a//b + 1

while h < n:
     listh = list[h]
     x = int(listh[0])
     y = int(listh[1])
     m = max(f1(th,x),f1(ah,y))
     th = Decimal(m*x)
     ah = Decimal(m*y)
     h += 1
print(int(th+ah))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 0
list = []
while i < n:
   list.append(input().split())
   i += 1
h = 1
listh = list[h]
listhh = list[h-1]
th = int(listh[0])
thh = int(listhh[0])
ah = int(listh[1])
ahh = int(listhh[1])
while h < n:
     listh = list[h]
     listhh = list[h-1]
     th = int(listh[0])
     ah = int(listh[1])
     l = 1
     m = 1
     while l*th < thh:
        l += 1
     while m*ah < ahh:
        m += 1
     if l>m:
        thh = th*l       
        ahh = ah*l
     else:
        thh = th*m
        ahh = ah*m
     h += 1
print(thh+ahh)

Fixed submission:
from decimal import Decimal
n = int(input())
i = 0
list = []
while i < n:
   list.append(input().split())
   i += 1
h = 0
th = 1.0
ah = 1.0

def f1(a,b):
     if a%b == 0:
          return a/b
     else:
          return a//b + 1

while h < n:
     listh = list[h]
     x = int(listh[0])
     y = int(listh[1])
     m = max(f1(th,x),f1(ah,y))
     th = Decimal(m*x)
     ah = Decimal(m*y)
     h += 1
print(int(th+ah))
Buggy python submission (verdict: Runtime Error):
n = input()
print((n*(n+1))/2)

Fixed submission:
n = int(input())
print(int((n*(n+1))/2))
Buggy python submission (verdict: Runtime Error):
x = input()
if x == 0:
  print(1)
  else:
    print(0)
    

Fixed submission:
print(1 - int(input()))

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

if x == 1:
  print(0)
  
if X == 0:
  print(1)
  


Fixed submission:
print(1 - int(input()))

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

if x == 1:
  print(0)
  
if X == 0:
  print(1)
  

Fixed submission:
print(1 - int(input()))
Buggy python submission (verdict: Runtime Error):
a, b, c, d = input().split() 
xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d
 
print(max([xy1, xy2, xy3, xy4]))

Fixed submission:
a, b, c, d = input().split() 
a = int(a)
b = int(b)
c = int(c)
d = int(d)
xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d
 
print(max([xy1, xy2, xy3, xy4]))

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
 
xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d
 
print(max([xy1, xy2, xy3, xy4]))

Fixed submission:
a, b, c, d = input().split() 
a = int(a)
b = int(b)
c = int(c)
d = int(d)
xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d
 
print(max([xy1, xy2, xy3, xy4]))

Buggy python submission (verdict: Runtime Error):
input_line = input()
x = input_line.split()
a = x[0]
b = x[1]
c = x[2]
d = x[3]

xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d

print(max([xy1, xy2, xy3, xy4]))

Fixed submission:
a, b, c, d = input().split() 
a = int(a)
b = int(b)
c = int(c)
d = int(d)
xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d
 
print(max([xy1, xy2, xy3, xy4]))