Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
count = 0

# for i in range(H):
#     for j in range(W):
#         if field[i][j] == start:
#             sy, sx = i, j
#         elif field[i][j] == goal:
#             gy, gx = i, j
sy,sx = 0,0
gy,gx = H-1,W-1
seen = [[0 for i in range(W)] for j in range(H)]
queue = [[sy,sx]]
flag = False
while queue != []:
    h,w = queue.pop(0)
    before = seen[h][w]
    for i in range(4):
        nh = h + dy[i]
        nw = w + dx[i]
        if (nh == gy) and (nw == gx):
            count = before+1
            flag = True
        if (0<=nh<H) and (0<=nw<W):
            if field[nh][nw] != 'X':
                if seen[nh][nw] == 0:
                    seen[nh][nw] = before+1
                    queue.append([nh,nw])
    if flag:
        break
whites = 0
for i in range(H):
    for j in range(W):
        if field[i][j] == '.':
            whites += 1
if count != 0 :
    print(whites - count-1)
else:
    print(-1)

Fixed submission:
H,W = map(int, input().split())
field = [list(input()) for _ in range(H)]
dy = [1,-1,0,0]
dx = [0,0,1,-1]


count = 0

# for i in range(H):
#     for j in range(W):
#         if field[i][j] == start:
#             sy, sx = i, j
#         elif field[i][j] == goal:
#             gy, gx = i, j
sy,sx = 0,0
gy,gx = H-1,W-1
seen = [[0 for i in range(W)] for j in range(H)]
queue = [[sy,sx]]
flag = False
while queue != []:
    h,w = queue.pop(0)
    before = seen[h][w]
    for i in range(4):
        nh = h + dy[i]
        nw = w + dx[i]
        if (nh == gy) and (nw == gx):
            count = before+1
            flag = True
        if (0<=nh<H) and (0<=nw<W):
            if field[nh][nw] != '#':
                if seen[nh][nw] == 0:
                    seen[nh][nw] = before+1
                    queue.append([nh,nw])
    if flag:
        break
whites = 0
for i in range(H):
    for j in range(W):
        if field[i][j] == '.':
            whites += 1
if count != 0 :
    print(whites - count-1)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = [1 / a[i] for i int range(n)]
print(sum(s))

Fixed submission:
n = int(input())
a = list(map(float, input().split()))
s = 0.0
for i in range(n):
    a[i] = 1 / a[i]
    s += a[i]
s = 1 / s
print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
S = ["".join(sorted(input())) for _ in range(n)]
d = []
for i in S:
  d.setdefault(i, 0)
  d[i] += 1
ans = 0
for value in d.values:
  ans = value * (value) / 2
print(ans)

Fixed submission:
n = int(input())
S = ["".join(list(sorted(input()))) for _ in range(n)]
d = {}
for i in S:
    d.setdefault(i, 0)
    d[i] += 1
ans = 0
for value in d.values():
    ans += value * (value - 1) / 2
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

sums = 0
for i in range(n-1):
    for j in range(i+1, n):
        sums += (a[i] * a[j])

print(sums % (10 ** 9 + 7))


Fixed submission:
s = input()
t = input()


ans = len(t)


for i in range(len(s)-len(t)+1):
    dif = 0
    for j in range(len(t)):
        if t[j] != s[i+j]:
            dif += 1

    ans = min(ans, dif)

print(ans)

# for i in range(len(t)+1, 0, -1):
#    for j in range(0, len(t)-i+1):
#        sb = t[j:j+i]
#        if sb in s[j:]:
#            print(sb, s[j:])
#            ans = len(t)-len(sb)
#            flag = True
#            break
#
#    if flag:
#        break
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import Counter as C

h, w, m = map(int, input().split())

hs, ws = [], []
hw = []

for i in range(m):
    hi, w = map(int, input().split())
    hs.append(hi)
    ws.append(w)
    hw.append([hi, w])


ch = C(hs).most_common()
cw = C(ws).most_common()
anss = []
pre_ans = -float('inf')
mrow = ch[0][0]
mcow = cw[0][0]

for num1, num2 in zip(ch, cw):
    row, cow = num1[0], num2[0]
    if mrow > row and mcow > cow:
        break
    ans1 = hs.count(row)
    ans2 = ws.count(cow)
    ans = ans1 + ans2

    if [row, cow] in hw:
        ans -= 1

    anss.append(ans)


print(max(anss))


Fixed submission:
import math
n, x, t = map(int, input().split())

y = math.ceil(n / x) * t
print(int(y))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import Counter as C

h, w, m = map(int, input().split())

hs, ws = [], []
hw = []

for i in range(m):
    hi, w = map(int, input().split())
    hs.append(hi)
    ws.append(w)
    hw.append([hi, w])


ch = C(hs).most_common()
cw = C(ws).most_common()
anss = []
pre_ans = -float('inf')
mrow = ch[0][0]
mcow = cw[0][0]

for num1, num2 in zip(ch, cw):
    row, cow = num1[0], num2[0]
    if mrow > row and mcow > cow:
        break
    ans1 = hs.count(row)
    ans2 = ws.count(cow)
    ans = ans1 + ans2

    if [row, cow] in hw:
        ans -= 1

    anss.append(ans)

    if pre_ans >= ans:
        ans = pre_ans
    else:
        pre_ans = ans


print(max(anss))


Fixed submission:
import math
n, x, t = map(int, input().split())

y = math.ceil(n / x) * t
print(int(y))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = input()

maxs = 0
ans = []
for a in s:
    if a == 'R':
        maxs += 1
    else:
        ans.append(maxs)
        maxs = 0


print(max(ans))


Fixed submission:
# -*- coding: utf-8 -*-
s = input()

maxs = 0
ans = []
for a in s:
    if a == 'R':
        maxs += 1
    else:
        ans.append(maxs)
        maxs = 0


ans.append(maxs)
print(max(ans))
Buggy python submission (verdict: Runtime Error):
k = int(input())

if k % 2 == 0 or k % 5 ==0:
  print(-1)
else:
  n = 7
  cnt = 1
  for i in range(k):
    n = (n * 10 +7) % k
    if n % k==0:
      break
      
    cnt +=1
    
print(cnt)    
    
    

Fixed submission:

k = int(input())

if k % 2 == 0 or k % 5 == 0:
    print(-1)
else:
    n = 7
    cnt = 1
    for i in range(k):
        if n % k == 0:
            break
        cnt += 1
        n = (n * 10 + 7) % k
    print(cnt)

Buggy python submission (verdict: Runtime Error):
k = input()
nana = int((len(k)-1)*'7')
ans = len(k)
k = int(k)
flag = False

def is_prime(q):
    q = abs(q)
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False
    return pow(2, q-1, q) == 1


if is_prime(k):
    print(k-1)
else:
    for i in range(10000000):
        nana = (nana * 10) + 7
        if nana % k == 0:
            flag = True
            break
        ans += 1

    if flag:
        print(ans)
    else:
        print('-1')


Fixed submission:

k = int(input())

if k % 2 == 0 or k % 5 == 0:
    print(-1)
else:
    n = 7
    cnt = 1
    for i in range(k):
        if n % k == 0:
            break
        cnt += 1
        n = (n * 10 + 7) % k
    print(cnt)

Buggy python submission (verdict: Runtime Error):
k = input()
nana = int((len(k)-1)*'7')
ans = len(k)
k = int(k)
flag = False

for i in range(10000000):
    nana = (nana * 10) + 7
    if nana % k == 0:
        flag = True
        break
    ans += 1

if flag:
    print(ans)
else:
    print('-1')


Fixed submission:

k = int(input())

if k % 2 == 0 or k % 5 == 0:
    print(-1)
else:
    n = 7
    cnt = 1
    for i in range(k):
        if n % k == 0:
            break
        cnt += 1
        n = (n * 10 + 7) % k
    print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n = int(input())
cs = input()
r_num = 0
w_num = 0
# RRR|WWWW にする

for c in cs:
    if c == 'R':
        r_num += 1
    elif c == 'W':
        w_num += 1

if r_num == 0 or w_num == 0:
    print(0)


else:
    temp_W = 0
    temp_R = 0
    ans = []
    for i in range(len(cs)+1):
        #print('i:', i, cs[i:])
        #print('i_r:', i, cs[:i])
        W = w_num - cs[i:].count("W")
        R = r_num - cs[:i].count("R")
        ans.append(max(W, R))

    print(min(ans))


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
cs = input()
r_num = 0
w_num = 0
# RRR|WWWW にする
r_num = cs.count('R')
w_num = cs.count('W')

if r_num == 0 or w_num == 0:
    print(0)
else:
    ans = []
    W = 0
    rl_num = 0
    for c in cs:
        if c == 'R':
            rl_num += 1
        elif c == 'W':
            W += 1
        R = r_num - rl_num
        ans.append(max(W, R))

    print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
score = 1
for i in a[:k]:
    score *= i


for num, i in enumerate(range(k, n)):
    k_i = score * a[i] / a[num]
    if score < k_i:
        print('Yes')
    else:
        print('No')

    score = k_i


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

for num, i in enumerate(range(k, n)):
    if a[num] < a[i]:
        print('Yes')
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np
h, w, k = map(int, input().split())
c = []
blacks = []
all_b = 0
ans = 0

for i in range(h):
    temp = input()
    temp_list = []
    for t in temp:
        temp_list.append(t)

    c.append(temp_list)
    blacks.append(c[i].count('#'))
    all_b += blacks[i]

c_t = np.array(c).T.tolist()

if all_b == k:
    ans += 1

for i in range(h):
    if k == all_b - blacks[i]:
        ans += 1

for i in range(w):
    if k == all_b - c_t[i].count('#'):
        ans += 1


for i in range(h):
    s = blacks[i]
    for j in range(i+1, h):
        if i != j:
            if k == all_b - s - blacks[j]:
                ans += 1


for i in range(w):
    temp = c_t[i].count('#')
    for j in range(i+1, w):
        if i != j:
            temp_2 = c_t[j].count('#')
            if k == all_b - temp - temp_2:
                ans += 1


for i in range(h):
    s = blacks[i]
    for j in range(w):
        counter_t = c_t[j].count('#')
        if k == all_b - counter_t - s + c[i][j].count('#'):
            ans += 1


print(ans)


Fixed submission:
n = int(input())
if n % 1000 == 0:
    ans = 0
else:
    ans = 1000 - (n % 1000)

print(ans)
Buggy python submission (verdict: Runtime Error):


def main():
    n, m, k = map(int, input().split())
    aa = list(map(int, input().split()))
    bb = list(map(int, input().split()))
    ans = []
    time_sum = 0
    for i in range(n):
        for j in range(1, m):
            time_sum = sum(aa[:i]) + sum(bb[:j])
            if time_sum <= k:
                ans.append(i+j)

    if(len(ans) == 1):
        return ans[0]
    else:
        return max(ans)


if __name__ == '__main__':
    ans = main()
    print(ans)


Fixed submission:
a = int(input())
ans = 0

for i in range(1, 4):
    ans += a ** i

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque
import sys
input = sys.stdin.readline

n, m = map(int, input().split())

g = [[] for _ in range(n)]  # 隣接リスト

for _ in range(m):
    a, b = [int(x) for x in input().split()]
    g[a-1].append(b-1)
    g[b-1].append(a-1)


def bfs(u):
    queue = deque([u])
    d = [None] * n  # uからの距離の初期化
    d[u] = 0  # 自分との距離は0
    while queue:
        v = queue.popleft()
        for i in g[v]:
            if d[i] is None:
                d[i] = d[v] + 1
                queue.append(i)
    return d


# 0からの各頂点の距離
d = bfs(0)
if len(d) != 0:
  print("Yes")
  for i in d[1:]:
    print(i)
else:
  print("No")

Fixed submission:
n = int(input())
ho = int(str(n)[-1])

if ho in [2, 4, 5, 7, 9]:
    print('hon')
elif ho in [0, 1, 6, 8]:
    print('pon')
else:
    print("bon")
Buggy python submission (verdict: Runtime Error):
s = input()

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


Fixed submission:
s = input()

if s == "ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
a, b = map(int, input().split())
i = 1
flag = False

while i < b:
    dis = i * k
    if dis >= a and dis <= b:
        flag = True
        break


if flag:
    print("OK")
else:
    print("NG")


Fixed submission:
k = int(input())
a, b = map(int, input().split())
i = 1
flag = False


while i < b:
    if k == 1:
        flag = True
        break
    dis = i * k
    if dis >= a and dis <= b:
        flag = True
        break

    i += 1


if flag:
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [int(input()) for _ in range(n)]
ans = set()

for i in s:
    ans.add(i)

print(len(ans))


Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
ans = set()

for i in s:
    ans.add(i)

print(len(ans))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
a = list(map(int, input().split()))

ans = n - sum(a)

if ans < 0:
    return -1
else:
    return ans


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

n, m = map(int, input().split())
a = list(map(int, input().split()))

ans = n - sum(a)

if ans < 0:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
P = list(map(int, input().split()))
c = 1
for i in range(1, len(P)):
    if P[i] == min(P[:i+1]):
        c += 1
print(c)


Fixed submission:
n = int(input())
P = list(map(int, input().split()))
c = 1
minv = P[0]  # その数より左にあるかずは全大きくさくなければならない
for i in range(1, len(P)):
    if minv > P[i]:
        c += 1
    minv = min(minv, P[i])
print(c)
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input().split())

if 500*i >= x:
    print("Yes")
else:
    print('No')


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

if 500*k >= x:
    print("Yes")
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        pass

print(a, b)


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

if a < k:
    k -= a
    a = 0
else:
    a -= k
    k = 0

b = max(0, b-k)
print(a, b)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
ls = [list(map(int, input().split())) for i in range(q)]
d = []
pre = 0
c = 0

for i in range(len(s)-1):
    if s[i:i+2] == 'AC':
        d.append(True)
    else:
        d.append(False)

for start, end in ls:
    ans = sum(d[start-1:end-1])
    print(ans)


Fixed submission:
n, q = map(int, input().split())
s = input()
ls = [list(map(int, input().split())) for i in range(q)]
d = [0]
pre = 0
c = 0

for i in range(len(s)-1):
    if s[i:i+2] == 'AC':
        d.append(d[i]+1)
    else:
        d.append(d[i])



for start, end in ls:
    print(d[end-1]-d[start-1])
Buggy python submission (verdict: Runtime Error):
from itertools import product

h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
visited = []

def dfs(p):
    if s[p[1]][p[0]] == '.':
        return None

    temp = [1 if s[p[0]+x][p[1]+y] == '#' else 0 for (y, x) in [[1, 0], [0, 1], [0, -1], [-1, 0]]
            if 0 <= x+p[0] < len(s[0]) and 0 <= y+p[1] < len(s)]
    if sum(temp) <= 0:
        print('No')
        exit(0)


for i in range(len(s)):
    for j in range(len(s[0])):
        dfs([j, i])
print('Yes')


Fixed submission:
from itertools import product

h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
visited = []

def dfs(p):
    if s[p[0]][p[1]] == '.':  # p[0]gatate , p[1] gayoko
        return None

    temp = [1 if s[p[0]+y][p[1]+x] == '#' else 0 for (x, y) in [[1, 0], [0, 1], [0, -1], [-1, 0]] if 0 <= y+p[0] < h and 0 <= x+p[1] < w]
    if sum(temp) <= 0:
        print('No')
        exit(0)


for i in range(len(s)):
    for j in range(len(s[0])):
        dfs([i, j])
print('Yes')

Buggy python submission (verdict: Runtime Error):
from itertools import product
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
visited = []

def dfs(p):
    if p in visited or s[p[0]][p[1]] == '.':
        return None

    temp = [1 if s[p[0]+x][p[1]+y] == '#' else 0 for (y, x) in [[1, 0], [0, 1], [0, -1], [-1, 0]]
            if 0 <= x+p[0] < len(s[0]) and 0 <= y+p[1] < len(s)]
    if sum(temp) <= 0:
        print('No')
        exit(0)


for i in range(len(s)):
    for j in range(len(s[0])):
        dfs([j, i])
print('Yes')


Fixed submission:
from itertools import product

h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
visited = []

def dfs(p):
    if s[p[0]][p[1]] == '.':  # p[0]gatate , p[1] gayoko
        return None

    temp = [1 if s[p[0]+y][p[1]+x] == '#' else 0 for (x, y) in [[1, 0], [0, 1], [0, -1], [-1, 0]] if 0 <= y+p[0] < h and 0 <= x+p[1] < w]
    if sum(temp) <= 0:
        print('No')
        exit(0)


for i in range(len(s)):
    for j in range(len(s[0])):
        dfs([i, j])
print('Yes')

Buggy python submission (verdict: Runtime Error):
from itertools import product
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
visited = []

def dfs(p):
    if p in visited or s[p[0]][p[1]] == '.':
        return None

    temp = [1 if s[p[0]+y][p[1]+x] == '#' else 0 for (y, x) in [[1, 0], [0, 1], [0, -1], [-1, 0]] if 0 <= y+p[0] < len(s) and 0 <= x+p[1] < len(s[0])]
    if sum(temp) <= 0:
        print('No')
        exit(0)


for i in range(len(s)):
    for j in range(len(s[0])):
        dfs([j, i])
print('Yes')


Fixed submission:
from itertools import product

h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
visited = []

def dfs(p):
    if s[p[0]][p[1]] == '.':  # p[0]gatate , p[1] gayoko
        return None

    temp = [1 if s[p[0]+y][p[1]+x] == '#' else 0 for (x, y) in [[1, 0], [0, 1], [0, -1], [-1, 0]] if 0 <= y+p[0] < h and 0 <= x+p[1] < w]
    if sum(temp) <= 0:
        print('No')
        exit(0)


for i in range(len(s)):
    for j in range(len(s[0])):
        dfs([i, j])
print('Yes')
Buggy python submission (verdict: Runtime Error):
MOD = 10**9 + 7
dp = {0: 1}

S = int(input())
for s in range(3, S+1):
  for term in range(3, s+1):
    if s - term < 0:
      break
    else:
      dp[s] = dp.get(s-term, 0) + dp.get(s, 0) % MOD

print(dp[S])

Fixed submission:
MOD = 10**9 + 7
dp = {0: 1}

S = int(input())
for s in range(3, S+1):
  for term in range(3, s+1):
    if s - term < 0:
      break
    else:
      dp[s] = dp.get(s-term, 0) + dp.get(s, 0) % MOD

print(dp.get(S, 0))
Buggy python submission (verdict: Runtime Error):
_MULTITEST = False
##
def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    neg = sum(1 for x in a if x < 0)
    pos = sum(1 for x in a if x > 0)
    zeroes = a.count(0)
    
    ### Set lower bound for answer
    ans = 0
    if pos == 0:
        if zeroes == 0:
            ans = -1 * (10**16)
    
    ### Solve by window-sliding
    # set some initial vars
    prod = 1
    zero_counter = 0
    for i in range(n-1, n-1-k, -1):
        if a[i] == 0:
            zero_counter += 1
        else:
            prod *= a[i]
    if zero_counter > 0:
        ans = max(ans, 0)
    else:
        ans = max(ans, prod)
    
    # sliding
    p1 = 0
    p2 = (n-k)
    while p2 < n:
        if a[p1] == 0:
            zero_counter += 1
        else:
            prod *= a[p1]
        if a[p2] == 0:
            zero_counter -= 1
        else:
            prod //= a[p2]
        p1 += 1; p2 += 1;
        if zero_counter > 0:
            ans = max(ans, 0)
        else:
            ans = max(ans, prod)
    
    ###
    #print(ans)
    print(ans % (10**9 + 7))


##
if __name__ == "__main__":
    t = (int(input()) if _MULTITEST else 1)
    for tt in range(t):
        solve()

Fixed submission:
_MULTITEST = False
##
def solve():
    n = int(input())
    k = (n // 1000) + (1 if n % 1000 != 0 else 0)
    print(k*1000 - n)

##
if __name__ == "__main__":
    t = (int(input()) if _MULTITEST else 1)
    for tt in range(t):
        solve()
Buggy python submission (verdict: Runtime Error):
st = input().strip().split()

a = int(st[0])
b = 0

for x in st[1]:
  if x == '.':
  else: b = b*10 + x

print(a*b//100)

Fixed submission:
print(eval(input().strip().replace(' ','*')))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
 
ans = 1
for x in a:
  if ans <= 10**18:
    ans = ans * x

print(-1 if ans > limit else ans)

Fixed submission:
print(eval(input().strip().replace(' ','*')))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())))
 
ans, limit = 1, 10**18
for x in a:
  ans = (ans if ans > limit else ans * x)

print(-1 if ans > limit else ans)

Fixed submission:
print(eval(input().strip().replace(' ','*')))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())))
 
ans, limit = 1, 10**18
for x in a: ans = (ans if ans > limit else ans * x)
 
print(-1 if ans > limit else ans)

Fixed submission:
print(eval(input().strip().replace(' ','*')))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())).sort()
 
ans = 1
for x in a:
  ans = (ans if ans > 10**18 else ans * x)
 
print(-1 if ans > 10**18 else ans)

Fixed submission:
print(eval(input().strip().replace(' ','*')))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())).sort()
 
ans = 1
limit = 10**18
for x in a:
  ans = (ans if ans > limit else ans * x)
 
print(-1 if ans > limit else ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
 
ans = 1
for x in a:
  if ans <= 10**18:
    ans = ans * x

print(-1 if ans > 10**18 else ans)
Buggy python submission (verdict: Runtime Error):
st = input().strip().split()

a = int(st[0])
b = 0

for x in st[1]:
  if x == '.':
  else: b = b*10 + int(x)

print(a*b//100)

Fixed submission:
st = input().strip().split()
 
a = int(st[0])
b = 0
d = 0
 
for x in st[1]:
  if x == '.':
    d = 1
  else:
    b = b*10 + int(x)
    d = d*10

print(a*b//d)

Buggy python submission (verdict: Runtime Error):
st = input().strip().split()

a = int(st[0])
b = 0

for x in st[1]:
  if x == '.':
  else: b = b*10 + x

print(a*b//100)

Fixed submission:
st = input().strip().split()
 
a = int(st[0])
b = 0
d = 0
 
for x in st[1]:
  if x == '.':
    d = 1
  else:
    b = b*10 + int(x)
    d = d*10

print(a*b//d)

Buggy python submission (verdict: Runtime Error):
st = input().strip().split()

mul = int(st[0])

b = 0
for x in st[1]:
  if x == '.':
  else: b = b*10 + x

print(a*b//100)

Fixed submission:
st = input().strip().split()
 
a = int(st[0])
b = 0
d = 0
 
for x in st[1]:
  if x == '.':
    d = 1
  else:
    b = b*10 + int(x)
    d = d*10

print(a*b//d)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
k = str(input())
R = [i for i in range(0, n) if k[i] == 'R']
G = [i for i in range(0, n) if k[i] == 'G']
B = [i for i in range(0, n) if k[i] == 'B']

ans = 0
for rx in R:
	for gx in G:
		for bx in B:
			a = [rx, gx, bx]
			a.sort()
			ans += (1 if a[1] - a[0] != a[2] - a[1] else 0)
print(ans)

Fixed submission:
n = int(input())
k = str(input())

k += '.'*n

R = [0] * (n*3)
G = [0] * (n*3)
B = [0] * (n*3)

dic = { 'R' : 0, 'G' : 0, 'B' : 0 };
for i in range(n-1, -1, -1):
    dic[k[i]] += 1
    R[i] = dic['R']
    G[i] = dic['G']
    B[i] = dic['B']

ans = 0
for i in range(n):
    for j in range(i+1, n):
        if k[i] != k[j]:
            charset = ['R', 'G', 'B'];
            charset.remove(k[i]);
            charset.remove(k[j]);
            ##
            if charset[0] == 'R':
                ans += R[j + 1]
                ans -= (1 if k[j + (j - i)] == 'R' else 0)
            if charset[0] == 'G':
                ans += G[j + 1]
                ans -= (1 if k[j + (j - i)] == 'G' else 0)
            if charset[0] == 'B':
                ans += B[j + 1]
                ans -= (1 if k[j + (j - i)] == 'B' else 0)

print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A > B:
  A, B = B, A

def check(X):
  global A
  global B
  return (int)(X*0.08) == A and (int)(X*0.1) == B
 
for x in range(1, B*11):
  if check(x):
    print(x)
    exit(0)
 
print(-1)

Fixed submission:
S = str(input())
print( "No\n" if (ord(S[0]) + ord(S[1]) + ord(S[2]) == ord(S[0])*3) else "Yes\n")