Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
pre_score = 1
for i in range(k):
  pre_score *= a[i]
for i in range(k, n):
  after_score = pre_score*a[i]/a[i-k]
  if after_score > pre_score:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
pre_score = 1
for i in range(k, n):
  after_score = pre_score*a[i]/a[i-k]
  if after_score > pre_score:
    print('Yes')
  else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
scores = []
for i in range(k-1, n):
  score = 1
  for j in range(i-k+1, i+1):
    score *= a[j]
  scores.append(score)
for i in range(1, len(scores)):
  if scores[i] > scores[i-1]:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
pre_score = 1
for i in range(k, n):
  after_score = pre_score*a[i]/a[i-k]
  if after_score > pre_score:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
n = int(input())
a = []
for i in range(1, int(n-1)):
  a += [i]*3
xyz_list = list(set(list(itertools.combinations(a, 3))))
xyz_list.sort()
nn = int(math.sqrt(n/6))
dic = {}
for i in range(1, n+1):
  dic[i] = 0
for xyz in xyz_list:
  x, y, z = xyz[0], xyz[1], xyz[2]
  if x > nn and y > nn and z > nn:
    break
  sum1 = x**2 + y**2 + z**2 + x*y + y*z + z*x
  if sum1 in dic:
    if len(set(xyz)) == 1:
      dic[sum1] += 1
    elif len(set(xyz)) == 2:
      dic[sum1] += 3
    else:
      dic[sum1] += 6
for i in range(1, n+1):
  print(dic[i])

Fixed submission:
import itertools
n = int(input())
dic = {}
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      f_xyz = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if f_xyz in dic:
        dic[f_xyz] += 1
      else:
        dic[f_xyz] = 1
for i in range(1, n+1):
  if i in dic:
    print(dic[i])
  else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
n = int(input())
a = []
for i in range(1, n+1):
  a += [i]*3
xyz_list = list(set(list(itertools.combinations(a, 3))))
xyz_list.sort()
nn = int(math.sqrt(n/6))
dic = {}
for i in range(1, n+1):
  dic[i] = 0
for xyz in xyz_list:
  x, y, z = xyz[0], xyz[1],xyz[2]
  if x > nn and y > nn and z > nn:
    break
  sum1 = x**2 + y**2 + z**2 + x*y + y*z + z*x
  if sum1 in dic:
    if len(set(xyz)) == 1:
      dic[sum1] += 1
    elif len(set(xyz)) == 2:
      dic[sum1] += 3
    else:
      dic[sum1] += 6
for i in range(1, n+1):
  print(dic[i])

Fixed submission:
import itertools
n = int(input())
dic = {}
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      f_xyz = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if f_xyz in dic:
        dic[f_xyz] += 1
      else:
        dic[f_xyz] = 1
for i in range(1, n+1):
  if i in dic:
    print(dic[i])
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
def InnerRating(N, R):
  if N >= 10:
    return R
  else:
    return R + 100 * (10 - N)
  
N, R = map(int, input())
print (InnerRating(N, R))

Fixed submission:
def InnerRating(N, R):
  if N >= 10:
    return R
  else:
    return R + 100 * (10 - N)
  
N, R = map(int, input().split())
print (InnerRating(N, R))
Buggy python submission (verdict: Runtime Error):
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list[map(int, input().split())]
print (PoorOrNot(number_list))

Fixed submission:
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list(map(int, input().split()))
print (PoorOrNot(number_list))

Buggy python submission (verdict: Runtime Error):
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list[map(int, input().split())]
print (PooeOrNot(number_list))

Fixed submission:
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list(map(int, input().split()))
print (PoorOrNot(number_list))

Buggy python submission (verdict: Runtime Error):
def PoorOrnot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list[map(int, input().split())]
print (PooeOrNot(number_list))

Fixed submission:
def PoorOrNot(number_list):
  number_dict = {}
  for num in number_list:
    if num not in number_dict:
      number_dict[num] = 1
  if len(number_dict) == 2:
    return "Yes"
  else:
    return "No"
  
number_list = list(map(int, input().split()))
print (PoorOrNot(number_list))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

ai = list(map(int, input().split()))

ans = 1

for a in ai:
    ans *= a

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

Fixed submission:
n = int(input())

ai = list(map(int, input().split()))

ans = 1

if 0 in ai:
    print(0)
else:
    for a in ai:
        ans *= a
        if ans > 1000000000000000000:
            ans = -1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal

numbers = input().split()
a = float(numbers[0])
b = Decimal(numbers[1])

c = a * b

print(int(c))


Fixed submission:
from decimal import Decimal

numbers = input().split()
a = Decimal(numbers[0])
b = Decimal(numbers[1])

c = a * b

print(int(c))
Buggy python submission (verdict: Time Limit Exceeded):
nm = input().split()
n = int(nm[0])
m = int(nm[1])

roads = [[] for i in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    roads[a-1].append(b-1)
    roads[b-1].append(a-1)

visited = [0]
output = [0]*n
shortest = [0]
while len(visited) < n:
    for i in range(len(shortest)):
        for j in range(len(roads[shortest[i]])):
            if roads[shortest[i]][j] not in visited:
                visited.append(roads[shortest[i]][j])
                shortest.append(roads[shortest[i]][j])
                output[roads[shortest[i]][j]] = shortest[i]

print('Yes')
for i in range(1, len(output)):
    print(output[i]+1)


Fixed submission:
from collections import deque

n, m = map(int, input().split())
room = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    room[a-1].append(b)
    room[b-1].append(a)

point = [0 for i in range(n)]
d = deque([0])

while len(d) > 0:
    p = d.popleft()
    for v in room[p]:
        if point[v-1] == 0:
            d.append(v-1)
            point[v-1] = p+1

print('Yes')
for i in range(1, n):
    print(point[i])

Buggy python submission (verdict: Time Limit Exceeded):
nm = input().split()
n = int(nm[0])
m = int(nm[1])

roads = []

for i in range(m):
    a = input().split()
    roads.append([int(a[0]), int(a[1])])

visited = [1]
output = [0]*(n-1)
shortest = [1]
while len(visited) < n:
    for i in range(len(shortest)):
        for k in range(len(roads)):
            if shortest[i] in roads[k]:
                t = roads[k].index(shortest[i])
                if roads[k][(t+1) % 2] not in visited:
                    shortest.append(roads[k][(t+1) % 2])
                    visited.append(roads[k][(t+1) % 2])
                    output[roads[k][(t+1) % 2] - 2] = shortest[i]

print('Yes')
for i in range(len(output)):
    print(output[i])


Fixed submission:
from collections import deque

n, m = map(int, input().split())
room = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    room[a-1].append(b)
    room[b-1].append(a)

point = [0 for i in range(n)]
d = deque([0])

while len(d) > 0:
    p = d.popleft()
    for v in room[p]:
        if point[v-1] == 0:
            d.append(v-1)
            point[v-1] = p+1

print('Yes')
for i in range(1, n):
    print(point[i])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
port = list(map(int, input().split()))
visited = [1]
current = 1

t = k

while port[current-1] not in visited and t > 0:
    visited.append(port[current-1])
    current = port[current-1]
    t -= 1

if t > 0:
    s = visited.index(port[current-1])
    bubun = visited[s:]
    g = (k-s) % len(bubun)
    print(bubun[g])
else:
    print(current)


Fixed submission:
n, k = map(int, input().split())
port = list(map(int, input().split()))
visited = [1]
flag = [False for i in range(n)]
current = 1

t = k

while flag[port[current-1]-1] == False and t > 0:
    visited.append(port[current-1])
    flag[port[current-1]-1] = True
    current = port[current-1]
    t -= 1

if t > 0:
    s = visited.index(port[current-1])
    bubun = visited[s:]
    g = (k-s) % len(bubun)
    print(bubun[g])
else:
    print(current)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
port = list(map(int, input().split()))
visited = [1]
current = 1

t = k

while port[current-1] not in visited and t > 0:
    visited.append(port[current-1])
    current = port[current-1]
    t -= 1

if t > 0:
    s = visited.index(port[current-1])
    bubun = visited[s:]
    g = (k-s) % len(bubun)
    print(bubun[g])
else:
    print(current)


Fixed submission:
n, k = map(int, input().split())
port = list(map(int, input().split()))
visited = [1]
flag = [False for i in range(n)]
current = 1

t = k

while flag[port[current-1]-1] == False and t > 0:
    visited.append(port[current-1])
    flag[port[current-1]-1] = True
    current = port[current-1]
    t -= 1

if t > 0:
    s = visited.index(port[current-1])
    bubun = visited[s:]
    g = (k-s) % len(bubun)
    print(bubun[g])
else:
    print(current)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

vary = []

for i in range(n):
    char = input()
    if char not in vary:
        vary.append(char)

print(len(vary))


Fixed submission:
n = int(input())

vary = []

for i in range(n):
    vary.append(input())

uni = list(set(vary))

print(len(uni))

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

vary = []

for i in range(n):
    char = input()
    if char not in vary:
        vary.append(char)

print(len(vary))


Fixed submission:
n = int(input())

vary = []

for i in range(n):
    vary.append(input())

uni = list(set(vary))

print(len(uni))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = len(s)

m = [0 for i in range(2019)]
m[0] = 1
a = 0
for i in reversed(range(0, t)):
    a += 10**(t-i-1) * int(s[i])
    a = a % 2019
    m[a] += 1

def triangle(n):
    if n > 1:
        return n * (n-1) // 2
    else:
        return 0

p = list(map(triangle, m))
# print(p)
print(sum(p))


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

x = []
y = 0

while 10 ** y % 2019 not in x:
    x.append(10 ** y % 2019)
    y += 1

z = len(x)

m = [0 for i in range(2019)]
m[0] = 1
a = 0
for i in reversed(range(0, t)):
    a += x[(t-i-1) % z] * (int(s[i]) % 2019)
    a = a % 2019
    m[a] += 1

def triangle(n):
    if n > 1:
        return n * (n-1) // 2
    else:
        return 0

p = list(map(triangle, m))
# print(p)
print(sum(p))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

s = input()
t = len(s)

m = np.array([0])
a = 0
for i in reversed(range(0, t)):
    a += 10**(t-i-1) * int(s[i])
    a = a % 2019
    m = np.append(m, a)

n = np.sort(m)

c = 0
d = 0

for i in range(t-1):
    if n[i] == n[i+1]:
        c += 1
        d += c
    else:
        c = 0

print(d)


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

x = []
y = 0

while 10 ** y % 2019 not in x:
    x.append(10 ** y % 2019)
    y += 1

z = len(x)

m = [0 for i in range(2019)]
m[0] = 1
a = 0
for i in reversed(range(0, t)):
    a += x[(t-i-1) % z] * (int(s[i]) % 2019)
    a = a % 2019
    m[a] += 1

def triangle(n):
    if n > 1:
        return n * (n-1) // 2
    else:
        return 0

p = list(map(triangle, m))
# print(p)
print(sum(p))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = len(s)

m = [0]
a = 0
for i in reversed(range(0, t)):
    a += 10**(t-i-1) * int(s[i])
    a = a % 2019
    m.append(a)

n = sorted(m)

c = 0
d = 0

for i in range(t-1):
    if n[i] == n[i+1]:
        c += 1
        d += c
    else:
        c = 0

print(d)


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

x = []
y = 0

while 10 ** y % 2019 not in x:
    x.append(10 ** y % 2019)
    y += 1

z = len(x)

m = [0 for i in range(2019)]
m[0] = 1
a = 0
for i in reversed(range(0, t)):
    a += x[(t-i-1) % z] * (int(s[i]) % 2019)
    a = a % 2019
    m[a] += 1

def triangle(n):
    if n > 1:
        return n * (n-1) // 2
    else:
        return 0

p = list(map(triangle, m))
# print(p)
print(sum(p))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = len(s)

m = [0]
a = 0
for i in reversed(range(0, t)):
    a += 10**(t-i-1) * int(s[i])
    a = a % 2019
    m.append(a)

n = sorted(m)

c = 0
d = 0

for i in range(t-1):
    if n[i] == n[i+1]:
        c += 1
        d += c
    else:
        c = 0

print(d)



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

x = []
y = 0

while 10 ** y % 2019 not in x:
    x.append(10 ** y % 2019)
    y += 1

z = len(x)

m = [0 for i in range(2019)]
m[0] = 1
a = 0
for i in reversed(range(0, t)):
    a += x[(t-i-1) % z] * (int(s[i]) % 2019)
    a = a % 2019
    m[a] += 1

def triangle(n):
    if n > 1:
        return n * (n-1) // 2
    else:
        return 0

p = list(map(triangle, m))
# print(p)
print(sum(p))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

rev = False

for i in range(q):
    inp = input()
    if inp == '1':
        rev = True if rev == False else False
    else:
        n = inp.split()[1]
        t = inp.split()[2]
        if n == '1':
            s = s + t if rev == True else t + s
        else:
            s = t + s if rev == True else s + t

if rev == True:
    s_rev = s[::-1]
    print(s_rev)
else:
    print(s)


Fixed submission:
from collections import deque

s = input()
d = deque(s)
q = int(input())

rev = False

for i in range(q):
    inp = input()
    if inp == '1':
        rev = True if rev == False else False
    else:
        n = inp.split()[1]
        t = inp.split()[2]
        if n == '1':
            d.append(t) if rev == True else d.appendleft(t)
        else:
            d.appendleft(t) if rev == True else d.append(t)

if rev == True:
    d.reverse()

print(''.join(d))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

s = input()
a = deque(s)

q = int(input())

for i in range(q):
    inp = input()
    if inp == '1':
        a.reverse()
    else:
        if inp.split()[1] == '1':
            a.appendleft(inp.split()[2])
        else:
            a.append(inp.split()[2])
            
print(''.join(a))


Fixed submission:
from collections import deque

s = input()
d = deque(s)
q = int(input())

rev = False

for i in range(q):
    inp = input()
    if inp == '1':
        rev = True if rev == False else False
    else:
        n = inp.split()[1]
        t = inp.split()[2]
        if n == '1':
            d.append(t) if rev == True else d.appendleft(t)
        else:
            d.appendleft(t) if rev == True else d.append(t)

if rev == True:
    d.reverse()

print(''.join(d))
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

ans = 0
ai = 0

if k%2 == 0:
    print(-1)
    exit()

while True:
    ai = (ai*10 + 7)% k
    ans += 1
    if ai == 0:
        break
print(ans)


Fixed submission:
K = int(input())

if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

i = 0
ai = 0
while True:
    ai = (ai * 10 + 7) % K
    i += 1
    if ai == 0:
        break
print(i)

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

ans = 0
ai = 0

while True:
    ai = (ai*10 + 7)% k
    ans += 1
    if ai = 0:
        break
print(ans)

Fixed submission:
K = int(input())

if K % 2 == 0 or K % 5 == 0:
    print(-1)
    exit()

i = 0
ai = 0
while True:
    ai = (ai * 10 + 7) % K
    i += 1
    if ai == 0:
        break
print(i)
Buggy python submission (verdict: Runtime Error):
n = input()

money = 0
if int(n)%1000 == 0:
    print(0)
else:
    money = (int(n[:-3]) + 1)*1000 
    ans = money - int(n)
    print(ans)


Fixed submission:
n = input()

money = 0
if int(n)%1000 == 0:
    print(0)
elif 1000 > int(n):
    ans = 1000 - int(n)
    print(ans)
else:
    money = (int(n[:-3]) + 1)*1000
    ans = money - int(n)
    print(ans)
Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

count = 0
while k > 0:
    for i in range(n+m):
        if len(a) == 0:
            if len(b) == 0:
                k = 0
                break
            elif k >= b[0]:
                btop = b.pop(0)
                k -= btop
                count += 1
            else:
                k = 0
                break
        elif len(b) == 0:
            if len(a) == 0:
                k = 0
                break
            elif k >= a[0]:
                btop = a.pop(0)
                k -= atop
                count += 1
            else:
                k = 0
                break
                
        elif a[0] > k and b[0] > k:
            k = 0
            break
        elif b[0] >= a[0]:
            atop = a.pop(0)
            k -= atop
            count += 1
        elif a[0] > b[0]:
            btop = b.pop(0)
            k -= btop
            count += 1

print(count)


Fixed submission:
n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n): #累積和ai,bjを求める
 acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
 acum2.append(acum2[-1]+arr2[i])
ans=0
j=m
for i in range(n+1):
 if acum1[i]>k: #ai>Kであれば、どのようにjを選んでもai+bj<=Kとなることはないので探索を終了する
   break
 while acum2[j]>k-acum1[i] and j>0: #各iについて、bj<=K-aiを満たす最大のjを求める
   j-=1
 ans=max(ans,i+j)
print(ans)

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

count = 0
while k > 0:
    for i in range(n+m):
        if a[0] > k and b[0] > k:
            k = 0
            break
        elif b[0] >= a[0]:
            atop = a.pop(0)
            k -= atop
            count += 1
        elif a[0] > b[0]:
            btop = b.pop(0)
            k -= btop
            count += 1

print(count)


Fixed submission:
n,m,k=map(int,input().split())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
acum1=[0]
for i in range(n): #累積和ai,bjを求める
 acum1.append(acum1[-1]+arr1[i])
acum2=[0]
for i in range(m):
 acum2.append(acum2[-1]+arr2[i])
ans=0
j=m
for i in range(n+1):
 if acum1[i]>k: #ai>Kであれば、どのようにjを選んでもai+bj<=Kとなることはないので探索を終了する
   break
 while acum2[j]>k-acum1[i] and j>0: #各iについて、bj<=K-aiを満たす最大のjを求める
   j-=1
 ans=max(ans,i+j)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
chars = "Xabcdefghijklmnopqrstuvwxyz"

n_rem = n
ans = ""

while True:
    x = n_rem%26
    if x == 0:
        x = 26
    ans += chars[x]

    n_rem -= x

    if n_rem == 0:
        break

    n_rem //==26

print(ans[::-1])

Fixed submission:
def alpha2num(alpha):
    num=0
    for index, item in enumerate(list(alpha)):
        num += pow(26,len(alpha)-index-1)*(ord(item)-ord('A')+1)
    return num

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

n=int(input())

s = num2alpha(n)
print(s.lower())
Buggy python submission (verdict: Time Limit Exceeded):
import numpy

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

arra = numpy.array(a)

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


for j in range(q):
    numpy.place(arra, arra == b[j], c[j])
    print(sum(arra))


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
q = int(input())

counter = Counter(a)
sum_res = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    sum_res += (c-b)*counter[b]

    counter[c] += counter[b]
    counter[b] = 0
    print(sum_res)

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

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

for j in range(q):
    a = [c[j] if i == b[j] else i for i in a]
    print(sum(a))


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
q = int(input())

counter = Counter(a)
sum_res = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    sum_res += (c-b)*counter[b]

    counter[c] += counter[b]
    counter[b] = 0
    print(sum_res)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
lst=list(map(int, input().split()))
ans = 1
for i in lst:
    ans = ans * i

if ans > 10**18:
    print(-1)
    exit()

print(ans)
    


Fixed submission:
n=int(input())
lst=list(map(int, input().split()))
ans = 1
if 0 in lst:
    print(0)
    exit()

for i in lst:
    ans = ans * i
    if ans > 10**18:
        print(-1)
        exit()


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

ans = 1
if 0 in a:
    ans = 0
    print(ans)
    exit()
else:
    for i in a:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()
print(ans)


Fixed submission:
a,b=map(str, input().split())
A = int(a)
B = 100*int(b[0])+10*int(b[2])+ 1*int(b[3])
ans = A*B // 100
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b=map(str, input().split())
A = int(a)
B = 100*int(b[0])+10*int(b[1])+int(b[2])
ans = A*B / 100
print(int(ans))


Fixed submission:
a,b=map(str, input().split())
A = int(a)
B = 100*int(b[0])+10*int(b[2])+ 1*int(b[3])
ans = A*B // 100
print(ans)
Buggy python submission (verdict: Runtime Error):
k=int(input())
a,b=map(int, input().split())

while True:
    if a%k == 0:
        print("OK")
        break
    elif: b%k == 0:
        print("OK")
    elif b-a >= k:
        print("OK")
        break
    else:
        print("NG")
        break


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

print("OK" if a <= b//k*k else "NG")
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(str, input().split())

if m == "0":
    print("0", "0")
    exit()
else:
    p=[list(map(str,list(input().split()))) for i in range(int(m))]

acs = []
was = {}

ans1 = 0
ans2 = 0

for i in p:
    if i[1] == "AC" and i[0] not in acs:
        ans1 += 1
        acs.append(i[0])
        if i[0] in was.keys():
            ans2 += was[i[0]]
    elif i[1] == "WA" and i[0] not in was.keys():
        if i[0] not in acs:
            was[i[0]] = 1
    elif i[1] == "WA" and i[0] in was.keys():
        if i[0] not in acs:
            was[i[0]] += 1

print(ans1, ans2)


Fixed submission:
N, M = map(int, input().split())
AC = set()
wa = [0] * (N+1)
 
for _ in range(M):
    p, s = input().split()
    p = int(p)
    if not p in AC:
        if s == 'AC':
            AC.add(p)
        if s == 'WA':
            wa[p] += 1
 
wa_ans = 0
for i in AC:
    wa_ans += wa[i]
 
print(len(AC), wa_ans)