Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
a1 = sorted(a)
if a1[n-1]==a1[n-2]:
  flag = True ## true = have repeat
  maxone = a1[n-1]
else:
  flag = False ## false = no repeat
  maxone = a1[n-1]
  maxtwo = a1[n-2]
for i in range(n):
  if a[i]==1max and flag==True: print(maxone)
  elif a[i]==1max and flag==False: print(maxtwo)
  elif a[i]!=1max: print(maxone)


Fixed submission:
n = int(input())
num = []
maxnum = 0
count = 1
for i in range(n):
  a = int(input())
  if a>maxnum:
    maxnum = max(maxnum,a)
    count = 1
  elif a==maxnum:
    count += 1
  num.append(a)
  
for i in range(n):
  if count>1:
    print(maxnum)
  else:
    if num[i]!=maxnum:
      print(maxnum)
    else:
      subnum = num[0:i] + num[i+1:n]
      subnum = sorted(subnum)
      print(subnum[n-2])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
a1 = sorted(a)
if a1[n-1]==a1[n-2]:
  flag = True ## true = have repeat
  1max = a1[n-1]
else:
  flag = False ## false = no repeat
  1max = a1[n-1]
  2max = a1[n-2]
for i in range(n):
  if a[i]==1max and flag==True: print(1max)
  elif a[i]==1max and flag==False: print(2max)
  elif a[i]!=1max: print(1max)


Fixed submission:
n = int(input())
num = []
maxnum = 0
count = 1
for i in range(n):
  a = int(input())
  if a>maxnum:
    maxnum = max(maxnum,a)
    count = 1
  elif a==maxnum:
    count += 1
  num.append(a)
  
for i in range(n):
  if count>1:
    print(maxnum)
  else:
    if num[i]!=maxnum:
      print(maxnum)
    else:
      subnum = num[0:i] + num[i+1:n]
      subnum = sorted(subnum)
      print(subnum[n-2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num = []
for i in range(n):
  num.append(int(input()))
  
for i in range(n):
  subnum = num[0:i] + num[i+1:n]
  subnum = sorted(subnum)
  print(subnum[n-2])

Fixed submission:
n = int(input())
num = []
maxnum = 0
count = 1
for i in range(n):
  a = int(input())
  if a>maxnum:
    maxnum = max(maxnum,a)
    count = 1
  elif a==maxnum:
    count += 1
  num.append(a)
  
for i in range(n):
  if count>1:
    print(maxnum)
  else:
    if num[i]!=maxnum:
      print(maxnum)
    else:
      subnum = num[0:i] + num[i+1:n]
      subnum = sorted(subnum)
      print(subnum[n-2])
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
d = sorted(d)
l = d[n/2-1]
r = d[n/2]
print(r-l)


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

diff = sorted(diff)
l = diff[int(n/2)-1]
r = diff[int(n/2)]
print(r-l)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
total_num = b-a+1
# # of x%c==0
c_num = b//c - (a-1)//c
d_num = b//d - (a-1)//d
from fractions import gcd
lcm = c*d/gcd(c,d)
cd_num = b//lcm - (a-1)//lcm
print(total_num-c_num-d_num+cd_num)


Fixed submission:
s = input()
for i in range(1,4):
  if s[i]==s[i-1]:
    print('Bad')
    exit()
print('Good')

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())

n = b-a-1
n_c = n//c
n_d = n//d
n_gap = n//(c*d)

print(n-n_c-n_d+n_gap+1)

Fixed submission:
s = input()
for i in range(1,4):
  if s[i]==s[i-1]:
    print('Bad')
    exit()
print('Good')

Buggy python submission (verdict: Runtime Error):
s = list(map(int, input().split()))
for i in range(1,4):
  if s[i]==s[i-1]:
    print('Bad')
    exit()
print('Yes')

Fixed submission:
s = input()
for i in range(1,4):
  if s[i]==s[i-1]:
    print('Bad')
    exit()
print('Good')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
flag = [0]*(n+1)
for i in range(m):
  a = int(input())
  flag[a] = 1
num = 10**9+7
count = [0]*(n+1)
count[0] = 1
count[1] = 1 if 1 not in a else 0
for i in range(2,n+1):
  if flag[i]==0: count[i] = count[i-1] + count[i-2]
  count[i] = count[i]%num
print(count[n])


Fixed submission:
n,m = map(int, input().split())
num = list(int(input()) for _ in range(m))

count = [-1]*(n+1)
for stair in num:
  count[stair] = 0
  
count[0] = 1
count[1] = 1 if 1 not in num else 0

for i in range(2,n+1):
  if count[i] != 0:
  	count[i] = (count[i-1]+count[i-2]) % (10**9+7)
  
print(count[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
num = 10**9+7
count = [0]*(n+1)
count[0] = 1
count[1] = 1 if 1 not in a else 0
for i in range(2,n+1):
  if i not in a: count[i] = count[i-1] + count[i-2]
  count[i] = count[i]%num
print(count[n])


Fixed submission:
n,m = map(int, input().split())
num = list(int(input()) for _ in range(m))

count = [-1]*(n+1)
for stair in num:
  count[stair] = 0
  
count[0] = 1
count[1] = 1 if 1 not in num else 0

for i in range(2,n+1):
  if count[i] != 0:
  	count[i] = (count[i-1]+count[i-2]) % (10**9+7)
  
print(count[n])
Buggy python submission (verdict: Runtime Error):
n=int(input())
X=[]
for i in range(n):
    s,p=input().split()
    X.append((s,100-int(p),i+1))
X=sorted(X,key=lambda x:(x[0],x[1]))
for i in range(n):
    print(X[i][2])


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

p += a*3
ans = int(p/2)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = []
for i in range(m):
  ks = list(map(int,input().split()))
  s.append(ks)
p = list(map(int,input().split()))
ans = 0
for i in range(2**n):
  flag = True
  for j in range(m):
    count = 0
    for k in range(s[m][0]):
      if i & (1<<(s[m][k+1]-1)): count += 1
    if count%2!=p[j]: flag = False
  if flag==True: ans += 1
print(ans)


Fixed submission:
n,m = map(int,input().split())
light = [list(map(int,input().split())) for _ in range(m)]
p = list(map(int,input().split()))

ans = 0
for i in range(1<<n):
  flag = True
  for j in range(m):
    l = light[j][1:]
    count = 0
    for s in l:
      if i & (1<<(s-1)):
        count += 1
    if count%2 != p[j]:
      flag = False
  if flag==True:
    ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
light = [list(map(int,input().split())) for _ in range(m)]
p = list(map(int,input().split()))

ans = 0
for i in range(1<<n):
  flag = True
  for i in range(m):
    l = light[m][1:]
    count = 0
    for s in l:
      if i & (1<<(s-1)):
        count += 1
    if count%2 != p[m]:
      flag = False
  if flag==True:
    ans += 1
print(ans)

Fixed submission:
n,m = map(int,input().split())
light = [list(map(int,input().split())) for _ in range(m)]
p = list(map(int,input().split()))

ans = 0
for i in range(1<<n):
  flag = True
  for j in range(m):
    l = light[j][1:]
    count = 0
    for s in l:
      if i & (1<<(s-1)):
        count += 1
    if count%2 != p[j]:
      flag = False
  if flag==True:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
r = int(input())
d = int(input())
x = int(input())

for i in range(10):
  x = r*x - d
  print(x)

Fixed submission:
r,d,x=map(int,input().split())
y=[x]
for i in range(10):
  y.append(r*y[i]-d)
  print(y[i+1])

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

for i in range(10):
  x = r*x - d
  print(x)

Fixed submission:
r,d,x=map(int,input().split())
y=[x]
for i in range(10):
  y.append(r*y[i]-d)
  print(y[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
key = [i+1 for i in range(n)]
for i in range(m):
  l,r = map(int,input().split())
  new_key = [i for i in range(l,r+1)]
  key = list(set(new_key) & set(key))
  
print(len(key))
  

Fixed submission:
n,m = map(int,input().split())
key = [i+1 for i in range(n)]
lmax = 0
rmin = 10**5
for i in range(m):
  l,r = map(int,input().split())
  lmax = max(l,lmax)
  rmin = min(r,rmin)

num = rmin-lmax+1
print(num if num>0 else 0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

left = [0]*(n-1)
right = [0]*(n-1)
from fractions import gcd
for i in range(1,n-1):
  left[i] = gcd(left[i-1],a[i-1])
  right[n-i-1] = gcd(right[n-i],a[n-i])

ans = 1
for i in range(n-1):
  g = gcd(left[i],right[i])
  ans = max(ans,g)
print(ans)


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

from fractions import gcd
l = [0]
r = [0]
for i in range(n-1):
  l += [gcd(l[i],num[i])]
  r += [gcd(r[i],num[-i-1])]
  
print(max(gcd(r[i],l[-i-1]) for i in range(n)))

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

def gcd(n1,n2):
  if n1<n2:
    n1,n2 = n2,n1
  while (n2>0):
    r = n1%n2
    n1 = n2
    n2 = r
  return n1

def gcd_list(l):
  if len(l)==1: return l[0]
  else:
    g = gcd(l[0],l[1])
    for i in range(2,len(l)):
      g = gcd(g,l[i])
    return g
t_g = 1
for i in range(1,n-1):
  l_g = gcd_list(num[0:i])
  r_g = gcd_list(num[i+1:n])
  t_g = max(t_g,gcd(l_g,r_g))

t_g = max(t_g,gcd_list(num[1:n]))
t_g = max(t_g,gcd_list(num[0:n-1]))
print(t_g)

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

from fractions import gcd
l = [0]
r = [0]
for i in range(n-1):
  l += [gcd(l[i],num[i])]
  r += [gcd(r[i],num[-i-1])]
  
print(max(gcd(r[i],l[-i-1]) for i in range(n)))
Buggy python submission (verdict: Runtime Error):
time = [int(input()) for _ in range(5)]

import math
ans = 0
minmod = 10
for i in range(n):
  if time[i]%10!=0:
    minmod = min(minmod,time[i]%10)
  else:
    minmod = min(minmod,10)
  ans += math.ceil(time[i]/10)*10

ans -= (10-minmod)
print(ans)


Fixed submission:
time = [[int(input())] for _ in range(5)]

for i in range(5):
  if time[i][0]%10!=0:
    time[i].append(time[i][0]%10)
  else:
    time[i].append(10)

time = sorted(time, key = lambda time:time[1])
ans = 0
import math
for i in range(1,5):
  ans = ans + math.ceil(time[i][0]/10)*10
  
ans = ans + time[0][0]
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [int(input()) for _ in range(n)]
pmin = min(i for i in p)

import math
print(math.ceil(n/pmin)+4)


Fixed submission:
n = int(input())
transp = [int(input()) for _ in range(5)]
import math
print(math.ceil(n/min(transp))+4)
Buggy python submission (verdict: Runtime Error):
s = list(input())
key = ['A','T','G','C']

count = 0
ans = 0
for i in range(n):
  if s[i] in key: count += 1
  else: count = 0
  ans = max(ans,count)
print(ans)


Fixed submission:
s = list(input())
key = ['A','T','G','C']
count = 0
flag = False
ans = 0
for i in range(len(s)):
  if s[i] in key:
    count += 1
    flag = True
  if flag==True and (s[i] not in key):
    ans = max(ans,count)
    count = 0
    flag = False
ans = max(ans,count)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = list(input())
mark = [0]*(n-1)
for i in range(n-1):
  if s[i]=='A' and s[i+1]=='C':
    mark[i] = 1
for i in range(q):
  l,r = map(int,input().split())
  l -= 1
  r -= 1
  print(sum(mark[l:r]))

Fixed submission:
n,q = map(int,input().split())
s = list(input())
mark = [0]*(n+1)
for i in range(2,n+1):
  if s[i-2]=='A' and s[i-1]=='C':
    mark[i] = mark[i-1]+1
  else:
    mark[i] = mark[i-1]

for i in range(q):
  l,r = map(int,input().split())
  l = l-1
  r = r-1
  print(mark[r+1]-mark[l+1])
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab = sorted(ab, key=lambda ab:ab[0])

ans = 0
total = 0
for i in range(n):
  num = m-toal
  if ab[i][1]<=num:
    total += ab[i][1]
    ans += ab[i][0]*ab[i][1]
  else:
    total += num
    ans += num*ab[i][1]
    break
print(ans)


Fixed submission:
n,m = map(int,input().split())
drink = [list(map(int,input().split())) for _ in range(n)]
drink = sorted(drink, key=lambda drink:drink[0])
money = 0
total = 0
for i in range(n):
  if total+drink[i][1]<m:
    total += drink[i][1]
    money += drink[i][1]*drink[i][0]
  else:
    money += drink[i][0]*(m-total)
    print(money)
    exit()

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split()）
ab = [list(map(int,input().split())) for _ in range(n)]
ab = sorted(ab, key=lambda ab:ab[0])

ans = 0
total = 0
for i in range(n):
  num = m-toal
  if ab[i][1]<=num:
    total += ab[i][1]
    ans += ab[i][0]*ab[i][1]
  else:
    total += num
    ans += num*ab[i][1]
    break
print(ans)


Fixed submission:
n,m = map(int,input().split())
drink = [list(map(int,input().split())) for _ in range(n)]
drink = sorted(drink, key=lambda drink:drink[0])
money = 0
total = 0
for i in range(n):
  if total+drink[i][1]<m:
    total += drink[i][1]
    money += drink[i][1]*drink[i][0]
  else:
    money += drink[i][0]*(m-total)
    print(money)
    exit()
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split)
print(min(b//a,c))


Fixed submission:
a,b,c = map(int,input().split())
if b//a>=c: print(c)
else: print(b//a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

mod = 1000000007

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

print(ans)


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

mod = 1000000007
s = sum(a) % mod
ans = 0

for i in a:
    s -= i
    ans += s * i
    ans %= mod

print(ans)
Buggy python submission (verdict: Runtime Error):
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]


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

uf = UnionFind(n+1)

for i in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)

ans = 1
for i in range(1, n+1):
    ans = max(ans, uf.size(i))

print(ans)


Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]


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

uf = UnionFind(n+1)

for i in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)

ans = 1
for i in range(1, n+1):
    ans = max(ans, uf.size(i))

print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

for i in range(1, n):
    a[i] += a[i-1]
for i in range(1, m):
    b[i] += b[i-1]

I = bisect.bisect_right(a, k)
ans = bisect.bisect_right(b, k)
li = list(range(I))
li = li[::-1]
for i in li:
    tmp = bisect.bisect_right(b, k-a[i])
    if a[i] + b[tmp-1] <= k && tmp != 0:
        ans = max(ans, i+tmp+1)

print(ans)

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

a2 = [0] * (n + 1)
b2 = [0] * (m + 1)
for i in range(0, n):
    a2[i+1] = a[i] + a2[i]
for i in range(0, m):
    b2[i+1] = b[i] + b2[i]

ans = 0
for i in range(n+1):
    tmp = bisect.bisect_right(b2, k-a2[i]) - 1
    if a2[i] + b2[tmp] <= k and tmp >= 0:
        ans = max(ans, i+tmp)

print(ans)
Buggy python submission (verdict: Runtime Error):
########### E
H, W, M = map(int, input().split())
bombs = []
for _ in range(M):
    bomb = list(map(int, input().split()))
    bombs.append(bomb)

H_list = [0]*H
W_list = [0]*W
sign = True
for i in range(M):
    H_list[bombs[i][0]-1] += 1
    W_list[bombs[i][1]-1] += 1

max_H = [i for i,k in enumerate(H_list) if k == max(H_list)]
max_W = [i for i,k in enumerate(W_list) if k == max(W_list)]

cross = []

for i in max_H:
    for k in max_W:
        if [i+1,k+1] not in bombs:
            sign = False
            print(max(H_list) + max(W_list))
            break
    break

if sign:
    print(max(H_list) + max(W_list) -1)


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

num = math.ceil(n/x)

print(num*t)

Buggy python submission (verdict: Runtime Error):
from collections import deque
H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())

meiro = []
for i in range(H):
    meiro.append(list(map(str, input())))

check_list = deque()   
num = 0

def check0(i,k):   
    global H, W
    global check_list
    global num
    
    if k > 0:
        if meiro[i][k-1] == '.' or meiro[i][k-1] == num+1:
            meiro[i][k-1] = num  
            check_list.appendleft([i,k-1])
    if k < W-1:
        if meiro[i][k+1] == '.' or meiro[i][k+1] == num+1:
            meiro[i][k+1] = num  
            check_list.appendleft([i,k+1])
    if i < H-1:
        if meiro[i+1][k] == '.' or meiro[i+1][k] == num+1:
            meiro[i+1][k] = num 
            check_list.appendleft([i+1,k])
    if i > 0:
        if meiro[i-1][k] == '.' or meiro[i-1][k] == num+1:
            meiro[i-1][k] = num  
            check_list.appendleft([i-1,k])
    
    return check_list

def check1(i,k):
    global H,W
    global check_list
    global num
    for w in range(-2,3):
        for h in range(-2,3):
            ind = max(0,k-h)
            col = max(0,i-w)
            ind = min(H-1,ind)
            col = min(W-1,col)
            if meiro[ind][col] == '.':
                meiro[ind][col] = num+1
                check_list.append([ind, col])
                

meiro[Ch-1][Cw-1] = num
check_list.append([Ch-1,Cw-1])
while check_list != deque([]):

    position = check_list.popleft()
    if meiro[position[0]][position[1]] != num:
        num +=1
    check0(position[0],position[1])
    check1(position[0],position[1])
    
    
if meiro[Dh-1][Dw-1] == '.':
    print(-1)
else:
    print(meiro[Dh-1][Dw-1])

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

num = math.ceil(n/x)

print(num*t)
Buggy python submission (verdict: Time Limit Exceeded):
######### D 
from collections import deque
H, W = map(int, input().split())
Ch, Cw = map(lambda x:int(x)-1, input().split())
Dh, Dw = map(lambda x:int(x)-1, input().split())
meiro = []
for i in range(H):
    meiro.append(list(map(str, input())))
    
walk = [(0,1),(1,0),(0,-1),(-1,0)]
warp = [(i,j) for i in range(-2,3) for j in range(-2,3) if (i,j) not in [(0,0)]+walk]

q = deque()
q.append((Ch,Cw))
num = 0
meiro[Ch][Cw] = num


while q != deque():
#for _ in range(10):
    ph, pw = q.popleft()
    
    if meiro[ph][pw] != num:
        num += 1
    
    for h, w in walk:
        th = ph+h
        tw = pw+w
        
        if 0 <= th < H and 0 <= tw < W and meiro[th][tw] != '#' and meiro[th][tw] != meiro[ph][pw]:
            meiro[th][tw] = meiro[ph][pw]
            q.appendleft((th,tw))
    
    for h, w in warp:
        th = ph+h
        tw = pw+w
        
        if 0 <= th < H and 0 <= tw < W and meiro[th][tw] == '.':
            meiro[th][tw] = meiro[ph][pw] + 1
            q.append((th,tw))
    
if meiro[Dh][Dw] == '.':
    print(-1)
else:
    print(meiro[Dh][Dw])

Fixed submission:
######### D 
from collections import deque
H, W = map(int, input().split())
Ch, Cw = map(lambda x:int(x)-1, input().split())
Dh, Dw = map(lambda x:int(x)-1, input().split())
meiro = []
for i in range(H):
    meiro.append(list(map(str, input())))
    
walk = [(0,1),(1,0),(0,-1),(-1,0)]
warp = [(i,j) for i in range(-2,3) for j in range(-2,3) if (i,j) not in [(0,0)]+walk]

q = deque()
q.append((Ch,Cw))
num = 0
meiro[Ch][Cw] = num


while q != deque():
#for _ in range(10):
    ph, pw = q.popleft()
    
    if meiro[ph][pw] != num:
        num += 1
    
    for h, w in walk:
        th = ph+h
        tw = pw+w
        
        if 0 <= th < H and 0 <= tw < W and meiro[th][tw] != '#' and meiro[th][tw] != meiro[ph][pw]:
            meiro[th][tw] = meiro[ph][pw]
            q.appendleft((th,tw))
    
    for h, w in warp:
        th = ph+h
        tw = pw+w
        
        if 0 <= th < H and 0 <= tw < W and meiro[th][tw] == '.':
            meiro[th][tw] = meiro[ph][pw] + 1
            q.append((th,tw))
    
if meiro[Dh][Dw] == '.':
    print(-1)
else:
    print(meiro[Dh][Dw])
Buggy python submission (verdict: Runtime Error):
import math
a,b=input().split()
a=int(a)
c=b[0]+b[2]+b[3]
print(int(a*c/100))
#print(a*b)

Fixed submission:
import math
a,b=input().split()
a=int(a)
c=int(b[0]+b[2]+b[3])
print(int(a*c)//100)
#print(a*b)

Buggy python submission (verdict: Runtime Error):
import math
a,b=input().split()
a=int(a)
b=b*100
ans=math.floor(a*b/100)
print(ans)

Fixed submission:
import math
a,b=input().split()
a=int(a)
c=int(b[0]+b[2]+b[3])
print(int(a*c)//100)
#print(a*b)
Buggy python submission (verdict: Runtime Error):
import math 
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
bef=-100
count=0
for i in range(1,n+1):
    num=calc(i)
    if num==0:
        if bef!=0:
            if count==0:
                count+=1
            else:
                break
    kind.add(num)
    bef=num
print(bef)

Fixed submission:
import math
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
print(calc(min(n,b-1)))

Buggy python submission (verdict: Time Limit Exceeded):
import math 
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
kind=set()
bef=-100
count=0
for i in range(1,n+1):
    num=calc(i)
    if num in kind:
        if 0==num:
            if bef!=0:
                if count==0:
                    count+=1
                else:
                    break
    kind.add(num)
    bef=num
print(max(kind))

Fixed submission:
import math
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
print(calc(min(n,b-1)))

Buggy python submission (verdict: Time Limit Exceeded):
import math 
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
kind=set()
bef=-100
for i in range(1,n+1):
    num=calc(i)
    if bef!=num:
        if num in kind:
            break
    kind.add(num)
    bef=num
print(max(kind))

Fixed submission:
import math
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
print(calc(min(n,b-1)))