Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

if __name__ == "__main__":

    N = int(input())

    P = (map(int,input().split()))

    mult = 1
    for i in P:
        mult *= i

    if(math.log10(mult) > 18):
        print(-1)
    else:
        print(mult)



Fixed submission:
import sys

if __name__ == "__main__":
 
    N = int(input())
 
    P = list(map(int,input().split()))

    if(0 in P):
        print(0)
    else:
        P.sort()

        mult = 1
        for i in P:
            mult *= i 
            if (mult > 10 ** 18):
                print(-1)
                sys.exit()

        print(mult)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == "__main__":

    N = int(input())

    P = (map(int,input().split()))

    mult = 1
    for i in P:
        mult *= i

    A = 10 ** 18
    if(mult > A):
        print(-1)
    else:
        print(mult)



Fixed submission:
import sys

if __name__ == "__main__":
 
    N = int(input())
 
    P = list(map(int,input().split()))

    if(0 in P):
        print(0)
    else:
        P.sort()

        mult = 1
        for i in P:
            mult *= i 
            if (mult > 10 ** 18):
                print(-1)
                sys.exit()

        print(mult)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == "__main__":

    N = int(input())

    P = (map(int,input().split()))

    mult = 1
    for i in P:
        mult *= i

    if(mult > 10 ** 18):
        print(-1)
    else:
        print(mult)



Fixed submission:
import sys

if __name__ == "__main__":
 
    N = int(input())
 
    P = list(map(int,input().split()))

    if(0 in P):
        print(0)
    else:
        P.sort()

        mult = 1
        for i in P:
            mult *= i 
            if (mult > 10 ** 18):
                print(-1)
                sys.exit()

        print(mult)
Buggy python submission (verdict: Runtime Error):
def main(n):

    prime = []
    if n < 2:
        return 1
    for p in range(2,int(n**0.5)):
        cnt = 0
        if p*p > n:
            break
        while n%p == 0:
            n //= p
            cnt += 1
        prime.append((p,cnt))
    if n > 1:
        prime.append((n,1))
    return prime
                    
n = int(input())    
pf = main(n)

ans = 0
for p, f in pf:
    cnt = 1
    while f >= cnt:
        f -= cnt
        ans += 1
        cnt += 1

print(ans)


Fixed submission:
def main(n):

    prime = []
    if n < 2:
        prime.append((1,0))
    for p in range(2,int(n**0.5)):
        cnt = 0
        if p*p > n:
            break
        while n%p == 0:
            n //= p
            cnt += 1
        prime.append((p,cnt))
    if n > 1:
        prime.append((n,1))
    return prime
                    
n = int(input())    
pf = main(n)

ans = 0
for p, f in pf:
    cnt = 1
    while f >= cnt:
        f -= cnt
        ans += 1
        cnt += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    a = int(input())
    b = int(input())
    c = int(input())
    k = int(input())

    if (k <= a + b):
        print(a)
    else:
        print(a - k + a + b)


Fixed submission:
if __name__ == "__main__":
    num = list(map(int, input().split()))

    if (num[3] == 0):
        print(0)
    elif (num[0] == 0 and num[1] == 0 and num[2] == 0):
        print(0)
    elif (num[3] <= num[0]):
        print(num[3])
    else:
        print(num[0] - num[3] + num[0] + num[1])

Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    A = int(input())
    B = int(input())
    C = int(input())
    K = int(input())
    
    if (K <= A + B):
        print(A)
    else:
        print(A - K + A + B)


Fixed submission:
if __name__ == "__main__":
    num = list(map(int, input().split()))

    if (num[3] == 0):
        print(0)
    elif (num[0] == 0 and num[1] == 0 and num[2] == 0):
        print(0)
    elif (num[3] <= num[0]):
        print(num[3])
    else:
        print(num[0] - num[3] + num[0] + num[1])
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

if (a == b and b == c):
    print('No')
elif(a != c and a != b and b != c):
    print('No')
else:
    print('Yes')


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


if (a == b and b == c):
    print('No')
elif(a != c and a != b and b != c):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
s = input()

n = len(s)
ans = []
for i in range(n):
    if s[i] != '?':
        ans.append(s[i])
    else:
        if s[i-1] == 'P' and i > 0:
            ans.append('D')
        elif s[i-1] == '?'and i > 0:
            ans.append('D')
        elif s[i+1] == '?' and i < n:
            ans.append('P')
        elif s[i+1] == 'D' and i < n:
            ans.append('P')
        else:
            ans.append('D')
            
print(*ans,sep = '')
        


Fixed submission:
s = input()

n = len(s)
ans = []
for i in range(n):
    if s[i] != '?':
        ans.append(s[i])
    else:
        ans.append('D')
            
print(*ans,sep = '')

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

n = len(s)
ans = []
for i in range(n):
    if s[i] != '?':
        ans.append(s[i])
    else:
        if s[i-1] == 'P' and i > 0:
            ans.append('D')
        elif s[i-1] == '?'and i > 0:
            ans.append('D')
        elif s[i+1] == '?':
            ans.append('P')
        elif s[i+1] == 'D':
            ans.append('P')
        else:
            ans.append('D')
            
print(*ans,sep = '')


Fixed submission:
s = input()

n = len(s)
ans = []
for i in range(n):
    if s[i] != '?':
        ans.append(s[i])
    else:
        ans.append('D')
            
print(*ans,sep = '')
Buggy python submission (verdict: Runtime Error):
x = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
 
    return divisors


d = make_divisors(x)


for i in d:
    for b in range(-100,100):
        a = i + b
        if x // i == a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4:
            ans = [a,b]
            break
        
print(ans)

Fixed submission:
x = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
 
    return divisors


d = make_divisors(x)


for i in d:
    for b in range(-10000,10000):
        a = i + b
        if x // i == a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4:
            ans = [str(a),str(b)]
            break
        
print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = [int(i) for i in input().split()]
 
ans = [0 for _ in range(b)]
 
for i in range(b):
    ans[i] = (a*i // b - a * (i // b))
    
ans = ans[:n+1] if n < b else ans
 
print(max(ans))

Fixed submission:
a,b,n = [int(i) for i in input().split()]
 
x = min(n,b-1)
print(a*x // b)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = [int(i) for i in input().split()]

ans = [0 for _ in range(b)]

for i in range(b):
    ans[i] = (a*i // b - a * (i // b))
    
ans = ans[:n+1] if n < b else ans

print(max(ans))

Fixed submission:
a,b,n = [int(i) for i in input().split()]
 
x = min(n,b-1)
print(a*x // b)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = [int(i) for i in input().split()]

ans = [0 for _ in range(b)]

for i in range(b):
    ans[i] = (a*i // b - a * (i // b))
    
ans = ans[:n+1]

print(max(ans))

Fixed submission:
a,b,n = [int(i) for i in input().split()]
 
x = min(n,b-1)
print(a*x // b)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
s = np.array([i for i in input()])

r = np.sum(s == 'R')
b = np.sum(s == 'B')
g = np.sum(s == 'G')

    
ct = 0
for i in range(n):
    for j in range(i + 1, n):
        k = j + j - i
        if k >= n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ct += 1                

print(r*g*b-ct)

Fixed submission:
n = int(input())
s = input()

r = s.count("R")
g = s.count("G")
b = s.count("B")
 
ans = r*g*b
    
ct = 0
for i in range(n):
    for j in range(i + 1, n):
        k = j + j - i
        if k >= n:
            break
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ct += 1                

print(r*g*b-ct)
Buggy python submission (verdict: Runtime Error):
import bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()])
total = sum(al)

idx = bisect.bisect_left(al,total/(4*m))

if n - idx > m:
    print('Yes')
elif al[idx+1] == total/(4*m):
    print('No')
else:
    print('No')



Fixed submission:
import bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()],reverse = True)
total = sum(al)

l = al[:m]

if l[-1] >= total/(4*m):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()])
total = sum(al)

idx = bisect.bisect_left(al,total/(4*m))
idx = bisect.bisect_left(al,789)

if n - idx > m:
    print('Yes')
elif al[idx+1] == total/(4*m):
    print('No')
else:
    print('No')


Fixed submission:
import bisect
n,m = [int(i) for i in input().split()]
al = sorted([int(i) for i in input().split()],reverse = True)
total = sum(al)

l = al[:m]

if l[-1] >= total/(4*m):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
l = [int(i) for i in input().split()]

c = Counter(l)

for i in l:
    ans = sum([v * (v-1) // 2 for v in c.values()])
    print(ans - c[i] + 1)



Fixed submission:
from collections import Counter
n = int(input())
l = [int(i) for i in input().split()]

c = Counter(l)

total = sum([v * (v-1) // 2 for v in c.values()])
for i in l:
    print(total - c[i] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
l = [int(i) for i in input().split()]

c = Counter(l)

for i in l:
    ans = 0
    for k ,v in c.items():
        if k == i:
            ans += (v-1) * (v-2) // 2
        else:
            ans += v * (v-1) //2
    print(ans)



Fixed submission:
from collections import Counter
n = int(input())
l = [int(i) for i in input().split()]

c = Counter(l)

total = sum([v * (v-1) // 2 for v in c.values()])
for i in l:
    print(total - c[i] + 1)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
s = deque(i for i in input())
n = int(input())
l = [[i for i in input().split()] for _ in range(n)]

for i in l:
    if i[0] == '1':
        s.reverse()
    elif i[1] == '1':
        s.appendleft(i[2])
    else:
        s.append(i[2])
            

print(*s,sep = '')

Fixed submission:
from collections import deque
s = deque(i for i in input())
n = int(input())
l = [[i for i in input().split()] for _ in range(n)]

front = True

for i in l:
    if i[0] == '1':
        front = not front
    else:
        if front ^ (int(i[1]) == 1):
            s.append(i[2])
        else:
            s.appendleft(i[2])
            
ans = ''.join(s)

if front:
    print(ans)
else:
    ans = ans[::-1]
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = [int(i) for i in input().split()]
l = [int(i) + 1 for i in input().split()]

ans = 0
for i in range(n-k+1):
    sums = l[i:i+k]
    ans = max(ans,sum(sums)/2)
    
print(ans)
        

Fixed submission:
n,k = [int(i) for i in input().split()]
l = [int(i) + 1 for i in input().split()]

ans = [0 for _ in range(n+1)]
for i in range(n):
    ans[i+1] = ans[i]+ l[i]

expect = 0   
for i in range(k,n+1):
    expect = max(expect,(ans[i] - ans[i-k])/2)
    
print(expect)
Buggy python submission (verdict: Time Limit Exceeded):
h,n = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]

inf = float('inf')
memo = [inf for _ in range(h+1)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        # これめっちゃ大事やん
        j = min(i+x, h)
        memo[j] = min(memo[j],memo[i] + y)
print(memo[-1])




Fixed submission:
h,n = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]
 
inf = float('inf')
memo = [inf for _ in range(h+1)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        j = min(i+x, h)
        memo[j] = min(memo[j],memo[i] + y)
print(memo[-1])

Buggy python submission (verdict: Time Limit Exceeded):
h,n = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]

inf = float('inf')
memo = [inf for _ in range(10**5)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        memo[i+x] = min(memo[i+x],memo[i] + y)
print(min(memo[h:h+10000]))

Fixed submission:
h,n = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]
 
inf = float('inf')
memo = [inf for _ in range(h+1)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        j = min(i+x, h)
        memo[j] = min(memo[j],memo[i] + y)
print(memo[-1])

Buggy python submission (verdict: Time Limit Exceeded):
h,n = [int(i) for i in input().split()]

l = sorted([[int(i) for i in input().split()] for _ in range(n)],key = lambda x: x[0])

inf = float('inf')
memo = [inf for _ in range(10**5)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        memo[i+x] = min(memo[i+x],memo[i] + y)
print(min(memo[h:]))

Fixed submission:
h,n = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]
 
inf = float('inf')
memo = [inf for _ in range(h+1)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        j = min(i+x, h)
        memo[j] = min(memo[j],memo[i] + y)
print(memo[-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    calc = l[:i+1]
    if l[i] == min(calc):
        ans += 1
        
print(ans)
    


Fixed submission:
import numpy as np
n = int(input())
l = np.array([int(i) for i in input().split()])

q = np.minimum.accumulate(l)
ans = np.count_nonzero(l <= q)

print(ans)
Buggy python submission (verdict: Runtime Error):
n,k,s = [int(i) for i in input().split()]
 
ans_list = []
for i in range(n):
  if i < k:
    ans_list.append(str(s))
  else:
    ans_list.append(str(s+1))
    
print(*ans_list)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())

use = h if h >= w else w

print(n//use + 1 if n%use else n//use)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = sorted(list(itertools.permutations([i for i in range(1,n+1)])))

al = tuple([int(i) for i in input().split()])
bl = tuple([int(i) for i in input().split()])


a,b = 0,0


if al == bl:
    print(0)
else:
    for idx,i in enumerate(l):
        if i == al:
            a = idx
        elif i == bl:
            b = idx
        else:
            pass
        
    print(abs(a-b))

Fixed submission:
import itertools

n = int(input())
l = sorted(list(itertools.permutations([i for i in range(1,n+1)])))

al = tuple([int(i) for i in input().split()])
bl = tuple([int(i) for i in input().split()])


a,b = 0,0


if al == bl:
    print(0)
else:
    for idx,i in enumerate(l):
        if i == al:
            a = idx
        elif i == bl:
            b = idx
        else:
            pass
        
    print(abs(a-b))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = [int(i) for i in 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 = [int(i) for i in input().split()]
 
if a + b <= k:
  print(0,0)
elif k >= a:
  print(0, b - (k-a))
else:
  print(a-k,b)
Buggy python submission (verdict: Runtime Error):
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
  
  
x = int(input())

while True:
  if is_prime(x):
    print(x)
    break
  x += 1

Fixed submission:
import math 
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
  
  
x = int(input())

while True:
  if is_prime(x):
    print(x)
    break
  x += 1
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

problem = set(1,2,3)

print(problem - set(a,b))



Fixed submission:
a = int(input())
b = int(input())

problem = set([1,2,3])

print((problem - set([a,b])).pop())
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [int(i) for i in input()]

l = [str(i).zfill(3) for i in range(0,1000)]

ct = 0
for i in l:
  n0 = s.find(a[0])
  if n0==-1:
    continue
  n1 = s.find(a[1], n0+1)
  if n1==-1:
    continue
  n2 = s.find(a[2], n1+1)
  if n2!=-1:
    c += 1
   
print(ct)

Fixed submission:
n = int(input())
s = input()

l = [str(i).zfill(3) for i in range(0,1000)]

ct = 0
for i in l:
  n0 = s.find(i[0])
  if n0==-1:
    continue
  n1 = s.find(i[1], n0+1)
  if n1==-1:
    continue
  n2 = s.find(i[2], n1+1)
  if n2!=-1:
    ct += 1
   
print(ct)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = [int(i) for i in input()]
a = {i for i in itertools.combinations(s, 3)}


print(len(a))

Fixed submission:
n = int(input())
s = input()

l = [str(i).zfill(3) for i in range(0,1000)]

ct = 0
for i in l:
  n0 = s.find(i[0])
  if n0==-1:
    continue
  n1 = s.find(i[1], n0+1)
  if n1==-1:
    continue
  n2 = s.find(i[2], n1+1)
  if n2!=-1:
    ct += 1
   
print(ct)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = [int(i) for i in input()]
a = {i for i in itertools.combinations(s, 3)}

print(len(a))

Fixed submission:
n = int(input())
s = input()

l = [str(i).zfill(3) for i in range(0,1000)]

ct = 0
for i in l:
  n0 = s.find(i[0])
  if n0==-1:
    continue
  n1 = s.find(i[1], n0+1)
  if n1==-1:
    continue
  n2 = s.find(i[2], n1+1)
  if n2!=-1:
    ct += 1
   
print(ct)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
s = [int(i) for i in input()]
a = set(itertools.combinations(s, 3))

print(len(a))


Fixed submission:
n = int(input())
s = input()

l = [str(i).zfill(3) for i in range(0,1000)]

ct = 0
for i in l:
  n0 = s.find(i[0])
  if n0==-1:
    continue
  n1 = s.find(i[1], n0+1)
  if n1==-1:
    continue
  n2 = s.find(i[2], n1+1)
  if n2!=-1:
    ct += 1
   
print(ct)
Buggy python submission (verdict: Runtime Error):
prize = {1:300000,2:200000,3:100000}

a,b = [int(i) for i in input().split()]

if a == b == 1:
    print(1000000)
elif a < 4 and b < 4:
    print(prize[a] + prize[b])
elif a >= 4:
    print(prize[b])
elif b >= 4:
    print(prize[a])
else:
    print(0)


Fixed submission:
prize = {1:300000,2:200000,3:100000}

a,b = [int(i) for i in input().split()]

if a == b == 1:
    print(1000000)
elif a < 4 and b < 4:
    print(prize[a] + prize[b])
elif a >= 4 and b < 4:
    print(prize[b])
elif b >= 4 and a < 4:
    print(prize[a])
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x = [int(i) for i in input().split()]

if x <= (a**2*b)/2:
    height = x/(a*b)*2
    #余弦定理
    c = b**2 + height**2 - 2*b*height*math.cos(math.radians(90))
    h2 = b*height / math.sqrt(c)
    theta = math.degrees(math.asin(h2/height))
    print(theta)
else:
    square = a**2*b-(a**2*b - x)*2
    triangle = (a**2*b-x)
    ratio = square/triangle/2 + 1
    d = b/ratio
    height = triangle/(a*d)*2
    c = d**2 + height**2 - 2*d*height*math.cos(math.radians(90))
    h2 = d*height / math.sqrt(c)
    theta = math.degrees(math.asin(h2/height))
    print(theta)


Fixed submission:
import math
a,b,x = [int(i) for i in input().split()]

if x <= (a**2*b)/2:
    height = x/(a*b)*2
    #余弦定理
    c = b**2 + height**2 - 2*b*height*math.cos(math.radians(90))
    h2 = b*height / math.sqrt(c)
    theta = math.degrees(math.asin(h2/height))
    print(theta)
elif x < (a**2*b):
    square = a**2*b-(a**2*b - x)*2
    triangle = (a**2*b-x)
    ratio = square/triangle/2 + 1
    d = b/ratio
    height = triangle/(a*d)*2
    c = d**2 + height**2 - 2*d*height*math.cos(math.radians(90))
    h2 = d*height / math.sqrt(c)
    theta = math.degrees(math.asin(h2/height))
    print(theta)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
s = input()
n = int(input())

def f(s):
    prev = ''
    ct = 0
    for i in s:
        if i == prev:
            ct += 1
            prev = ''
        else:
            prev = i
    return ct
        

if len(set(s)) == 1:
    print(len(s) *n //2)
elif s[0]!=s[-1]:
    print(f(t) * n)
else:
    ct = f(s*2)
    
    ans = ct * (n//2) if n % 2 == 0 else ct*(n//2) + f(s)
    
    print(ans)


Fixed submission:
s = input()
n = int(input())

def f(s):
    prev = ''
    ct = 0
    for i in s:
        if i == prev:
            ct += 1
            prev = ''
        else:
            prev = i
    return ct
        

if len(set(s)) == 1:
    print(len(s) *n//2)
elif s[0]!=s[-1]:
    print(f(s) * n)
else:
    ans = f(s) + (f(s*2) - f(s)) * (n-1)
    print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
a,b = [int(i) for i in input().split()]

gcd = fractions.gcd(a,b)

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    return divisors

l = make_divisors(gcd)

print(len([i for i in l if is_prime(i)]) +1)

Fixed submission:
import fractions
import math
a,b = [int(i) for i in input().split()]

gcd = fractions.gcd(a,b)

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
 
    return divisors

l = make_divisors(gcd)

print(len([i for i in l if is_prime(i)]) +1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = [int(i) for i in input().split()]

l = [int(input()) for _ in range(q)]

point = [k]*n

for i in l:
    point = [j if idx +1 == i else j-1 for idx,j in enumerate(point)]


for i in point:
    if i <=0:
        print('No')
    else:
        print('Yes')

Fixed submission:
from collections import Counter
n,k,q = [int(i) for i in input().split()]

l = [int(input()) for _ in range(q)]
point = [k-q]*n
c = Counter(l)

[print('Yes') if j + c[idx+1] > 0 else print('No') for idx,j in enumerate(point)]
Buggy python submission (verdict: Runtime Error):
import bisect
n,m = [int(i) for i in input().split()]
l = sorted([int(i) for i in input().split()])
l2 = []
[bisect.insort(l,l.pop()//2,0,n) for _ in range(m)]
print(sum(l[0:n]))


Fixed submission:
import heapq
n,m = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
h = []
for i in l:
    i = -1*i
    heapq.heappush(h,i)
    
for _ in range(m):
    v = -heapq.heappop(h)
    heapq.heappush(h,-1*(v//2))
    
print(-sum(h))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n,m = [int(i) for i in input().split()]
l = sorted([int(i) for i in input().split()])
[bisect.insort(l,l[n-1]//2) for _ in range(m)]
    
print(sum(l[0:n]))

Fixed submission:
import heapq
n,m = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
h = []
for i in l:
    i = -1*i
    heapq.heappush(h,i)
    
for _ in range(m):
    v = -heapq.heappop(h)
    heapq.heappush(h,-1*(v//2))
    
print(-sum(h))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n,m = [int(i) for i in input().split()]
l = sorted([int(i) for i in input().split()])
for i in range(m):
    bisect.insort(l,l[n-1]//2)
    
print(sum(l[0:n]))

Fixed submission:
import heapq
n,m = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
h = []
for i in l:
    i = -1*i
    heapq.heappush(h,i)
    
for _ in range(m):
    v = -heapq.heappop(h)
    heapq.heappush(h,-1*(v//2))
    
print(-sum(h))