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


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, K = map(int, input().split())
mod = int(1e+9 + 7)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))


Fixed submission:
import math


def combinations_count(n, r):
    if n >= r:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        return 0


N, K = map(int, input().split())
mod = int(1e+9 + 7)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))

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


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, K = map(int, input().split())
mod = int(1e+9 + 7)
print(mod)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))


Fixed submission:
import math


def combinations_count(n, r):
    if n >= r:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        return 0


N, K = map(int, input().split())
mod = int(1e+9 + 7)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))

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


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N, K = map(int, input().split())
mod = 1e+9 + 7

for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))


Fixed submission:
import math


def combinations_count(n, r):
    if n >= r:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        return 0


N, K = map(int, input().split())
mod = int(1e+9 + 7)
for i in range(1, K+1):
    print(int(combinations_count(N-K+1, i) * combinations_count(K-1, i-1) % mod))
Buggy python submission (verdict: Runtime Error):
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])
XY.sort(key=lambda x: x[1])

PQ = {}
for i in range(1, len(XY)):
    pq = XY[i][0] - XY[i-1][0], XY[i][1] - XY[i-1][1]
    if pq in PQ.keys():
        PQ[pq] += 1
    else:
        PQ[pq] = 1
pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])


Fixed submission:
import sys

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])
XY.sort(key=lambda x: x[1])

if N == 1:
    print(1)
    sys.exit()

PQ = {}
for i in range(len(XY)):
    for j in range(len(XY)):
        pq = XY[i][0] - XY[j][0], XY[i][1] - XY[j][1]
        if pq == (0, 0):
            continue
        if pq in PQ.keys():
            PQ[pq] += 1
        else:
            PQ[pq] = 1

pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])

Buggy python submission (verdict: Runtime Error):
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[1])
XY.sort(key=lambda x: x[0])

PQ = {}
for i in range(1, len(XY)):
    pq = XY[i][0] - XY[i-1][0], XY[i][1] - XY[i-1][1]
    if pq in PQ.keys():
        PQ[pq] += 1
    else:
        PQ[pq] = 1
pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])


Fixed submission:
import sys

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])
XY.sort(key=lambda x: x[1])

if N == 1:
    print(1)
    sys.exit()

PQ = {}
for i in range(len(XY)):
    for j in range(len(XY)):
        pq = XY[i][0] - XY[j][0], XY[i][1] - XY[j][1]
        if pq == (0, 0):
            continue
        if pq in PQ.keys():
            PQ[pq] += 1
        else:
            PQ[pq] = 1

pq = max(PQ, key=lambda x: PQ[x])
print(N - PQ[pq])
Buggy python submission (verdict: Runtime Error):
import sys

N = int(input())

for i in range(26):
  for j in range(16):
    if N == i * 4 + j * 7:
      print('Yes')
      sys.exit()
print('No')

Fixed submission:
N, K = list(map(int, input().split(' ')))
print(0 if N % K == 0 else 1)
Buggy python submission (verdict: Runtime Error):
R = input()
if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else:
  print("AGC")

Fixed submission:
R = int(input())
if R < 1200:
  print("ABC")
elif R < 2800:
  print("ARC")
else:
  print("AGC")
Buggy python submission (verdict: Runtime Error):
s = input().split(" ")

if (s[0] * s[1]) / 2 == 0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a, b = input().split(" ")

a = int(a)
b = int(b)

if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")

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

nums = s.split()

if (nums[0] * nums[1]) / 2 == 0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a, b = input().split(" ")

a = int(a)
b = int(b)

if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
_ = input()
num_list = input().split(" ")
num_list = list(map(lambda x:int(x), num_list))
 
shift_counter = 0
 
while(True):
  if sum(num_list) % 2 != 0:
    break
  
  num_list = [x / 2 for x in num_list]
  shift_counter += 1
 
print(shift_counter)

Fixed submission:
string = input()

one_counter = 0
for s in string:
  if s =="1":
    one_counter += 1

print(one_counter)

Buggy python submission (verdict: Runtime Error):
_ = input()
num_list = input().split(" ")
num_list = list(map(lambda x:int(x), num_list))
 
shift_counter = 0
 
while(True):
  print(num_list)
  if sum(num_list) % 2 != 0:
    break
  
  num_list = [x / 2 for x in num_list]
  shift_counter += 1
 
print(shift_counter)

Fixed submission:
string = input()

one_counter = 0
for s in string:
  if s =="1":
    one_counter += 1

print(one_counter)

Buggy python submission (verdict: Runtime Error):
_ = input()
num_list = input().split(" ")
num_list = list(map(lambda x:int(x), num_list))
min_num = min(num_list)

shift_counter = 0

while(True):
  if min_num == 1:
    break
  
  min_num /= 2
  shift_counter += 1

print(shift_counter)

Fixed submission:
string = input()

one_counter = 0
for s in string:
  if s =="1":
    one_counter += 1

print(one_counter)
Buggy python submission (verdict: Runtime Error):
N = int(input())
b = list(map(int, input().split()))
a = [b[0]]
if N == 2:
  a.append[b[0]]
elif N > 2:
  for i in range(N-2):
    a.append(min(b[i], b[i+1]))
  a.append(b[N-2])

print(sum(a))

Fixed submission:
N = int(input())
b = list(map(int, input().split()))
a = [b[0]]
if N == 2:
  print(2*a[0])
elif N > 2:
  for i in range(N-2):
    a.append(min(b[i], b[i+1]))
  a.append(b[N-2])
  print(sum(a))
Buggy python submission (verdict: Runtime Error):
int(input())
print(3*(r**2))

Fixed submission:
r=int(input())
print(3*(r**2))
Buggy python submission (verdict: Runtime Error):
a = input()
s = input()

if a >= 3200:
    print(s)
else:
    print("red")

Fixed submission:
a = input()
s = raw_input()

if a >= 3200:
    print(s)
else:
    print("red")

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

if a >= 3200:
    print(s)
else:
    print("red")

Fixed submission:
a = input()
s = raw_input()

if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
n,k,q = [int(x) for x in input().split()]
li = []
score = [k]*n
for i in range(q):
    a = int(input())
    li.append(a)
    score = [x-1 for x in score]
    score[pe-1] = score[pe-1]+1
result = []
for i in range(len(score)):
    if score[i]>0:
        print('Yes')
    else:
        print('No')
        


Fixed submission:
n,k,q = [int(x) for x in input().split()]
li = []
for i in range(q):
    a = int(input())
    li.append(a)
score = [k] * (n + 1)
temp =[0]*(n+2)
for pe in li:
    temp[1] += (-1)
    temp[pe] -= (-1)
    temp[pe + 1] += (-1)
    temp[n + 1] -= (-1)

for i in range(1,n + 2):
    temp[i] += temp[i - 1]
#print(temp)
for i in range(1,n + 1):
    score[i] += temp[i]
    if(score[i] <= 0):
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = [int(x) for x in input().split()]
li = []
for i in range(q):
    a = int(input())
    li.append(a)
score = [k]*n
for pe in li:
    score = [x-1 for x in score]
    score[pe-1] = score[pe-1]+1
result = []
for i in range(len(score)):
    if score[i]>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n,k,q = [int(x) for x in input().split()]
li = []
for i in range(q):
    a = int(input())
    li.append(a)
score = [k] * (n + 1)
temp =[0]*(n+2)
for pe in li:
    temp[1] += (-1)
    temp[pe] -= (-1)
    temp[pe + 1] += (-1)
    temp[n + 1] -= (-1)

for i in range(1,n + 2):
    temp[i] += temp[i - 1]
#print(temp)
for i in range(1,n + 1):
    score[i] += temp[i]
    if(score[i] <= 0):
        print('No')
    else:
        print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = [int(x) for x in input().split()]
li = []
for i in range(q):
    a = int(input())
    li.append(a)
score = [k]*n
for pe in li:
    for k in range(len(score)):
        score[k] = score[k] - 1
    score[pe-1] = score[pe-1]+1
result = []
for i in range(len(score)):
    if score[i]>0:
        print('Yes')
    else:
        print('No')
        


Fixed submission:
n,k,q = [int(x) for x in input().split()]
li = []
for i in range(q):
    a = int(input())
    li.append(a)
score = [k] * (n + 1)
temp =[0]*(n+2)
for pe in li:
    temp[1] += (-1)
    temp[pe] -= (-1)
    temp[pe + 1] += (-1)
    temp[n + 1] -= (-1)

for i in range(1,n + 2):
    temp[i] += temp[i - 1]
#print(temp)
for i in range(1,n + 1):
    score[i] += temp[i]
    if(score[i] <= 0):
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
A = list(map(int, input().split()))
i=0
while i<m:
  i+=1
  t=A.index(max(A))
  A[t]=A[t]//2
print(sum(A))

Fixed submission:
N, M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse = True)
it = 0
for i in range(M):
    A[it]=A[it]//2
    if it<N-1:
        if A[it]<A[it+1] and A[0]<A[it+1]:
            it+=1
        else:
            A.sort(reverse = True)
            it = 0
    if it == N-1:
        A.sort(reverse = True)
        it = 0
print(sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
A = list(map(float, input().split()))
i=0
while i<m:
  i+=1
  tukaubasho=A.index(max(A))
  A[tukaubasho]=A[tukaubasho]/2
output=0
for a in A:
	output=output+(a//1)
print(int(output))

Fixed submission:
N, M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse = True)
it = 0
for i in range(M):
    A[it]=A[it]//2
    if it<N-1:
        if A[it]<A[it+1] and A[0]<A[it+1]:
            it+=1
        else:
            A.sort(reverse = True)
            it = 0
    if it == N-1:
        A.sort(reverse = True)
        it = 0
print(sum(A))
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=[int(i) for i in input().split()]
A = list(map(int,[input() for i in range(Q)]))

points = [K] * N

for a in A :
    for j,p in enumerate(points) :
        if j+1 != a :
            points[j] -= 1

for p in points :
    print('No') if p <= 0 else print('Yes')
        
    

Fixed submission:
N,K,Q=[int(i) for i in input().split()]
A = list(map(int,[input() for i in range(Q)]))
 
points = [K] * N
answers = [0] * N

for a in A :
   answers[a-1] += 1

sum = [x + y for (x, y) in zip(points, answers)]
aaa = [x - Q for (x) in sum]
for p in aaa :
    print('No') if p <= 0 else print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=[int(i) for i in input().split()]
A = list(map(int,[input() for i in range(Q)]))

points = [K] * N

for i in range(len(A)) :
    for j in range(len(points)) :
        if j+1 != A[i] :
            points[j] -= 1

for k in range(len(points)) :
    if points[k] <= 0 :
        print('No')
    else:
        print('Yes')

Fixed submission:
N,K,Q=[int(i) for i in input().split()]
A = list(map(int,[input() for i in range(Q)]))
 
points = [K] * N
answers = [0] * N

for a in A :
   answers[a-1] += 1

sum = [x + y for (x, y) in zip(points, answers)]
aaa = [x - Q for (x) in sum]
for p in aaa :
    print('No') if p <= 0 else print('Yes')
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, open(0))
if n == 1:
    print("Hello World")
else:
    print(a+b)


Fixed submission:
n, *t = map(int, open(0))
if n == 1:
    print("Hello World")
else:
    print(sum(t))

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, open(0).read().split())
if n == 1:
    print("Hello World")
else:
    print(a+b)


Fixed submission:
n, *t = map(int, open(0))
if n == 1:
    print("Hello World")
else:
    print(sum(t))

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:
    print("Hello World")
else:
    a,b=map(int, input().split())
    print(a+b)


Fixed submission:
n, *t = map(int, open(0))
if n == 1:
    print("Hello World")
else:
    print(sum(t))
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
print("01"[a%b])

Fixed submission:
a,b=map(int, input().split())
print(0 if a%b==0 else 1)
Buggy python submission (verdict: Runtime Error):
L, N = map(int, input().split())
s = [input() for i in range(N)]
s.sort()
print(''.join(s))


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

if A[0] == 5 and A[1] == 5 and A[2] == 7:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
L, N = map(int, input().split())
s = [input() for i in range(N)]
print("".join(sorted(s)))


Fixed submission:
N,L = map(int, input().split())
s = [input() for i in range(N)]
s.sort()
print(''.join(s))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n,k,q = map(int, input().split())
l = []
for i in range(n):
    l.append(k)
    
for i in range(q):
    a = int(input())
    l = list(map(lambda x: x - 1, l))
    l[a-1] += 1

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

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

n,k,q = map(int, input().split())
l = []
for i in range(n):
    l.append(0)

for i in range(q):
    a = int(input())
    l[a-1] += 1


for i in l:
    if i + k - q <= 0:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import numpy as np

n, m = map(int, input().split())
l = [int(n) for n in input().split()]
arr = np.asarray(l)

for j in range(m):
    i = np.argmax(l)
    l[i] = int(l[i]/2)
    if l[i] <= 0:
        l.remove(l[i])
        if len(l) == 0:
            break

print(sum(l))



Fixed submission:
# coding: utf-8
import heapq

n, m = map(int, input().split())
l = [ -1 * int(n) for n in input().split()]

heapq.heapify(l)

for i in range(m):
    a = heapq.heappop(l) * (-1)
    a = int(a/2)
    if a != 0:
        heapq.heappush(l, a * (-1))
    if len(l) == 0:
        break
    
    
print(sum(l) * (-1))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

n, m = map(int, input().split())
l = [int(n) for n in input().split()]

for j in range(m):
    i = l.index(max(l))
    l[i] = int(l[i]/2)
    if l[i] <= 0:
        l.remove(l[i])
        if len(l) == 0:
            break
        
print(sum(l))



Fixed submission:
# coding: utf-8
import heapq

n, m = map(int, input().split())
l = [ -1 * int(n) for n in input().split()]

heapq.heapify(l)

for i in range(m):
    a = heapq.heappop(l) * (-1)
    a = int(a/2)
    if a != 0:
        heapq.heappush(l, a * (-1))
    if len(l) == 0:
        break
    
    
print(sum(l) * (-1))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

n, m = map(int, input().split())
l = [int(n) for n in input().split()]

for j in range(m):
    i = l.index(max(l))
    k = int(l.pop(i)/2)
    if k > 0:
        l.append(k)
    if len(l) == 0:
        break
    
print(sum(l))



Fixed submission:
# coding: utf-8
import heapq

n, m = map(int, input().split())
l = [ -1 * int(n) for n in input().split()]

heapq.heapify(l)

for i in range(m):
    a = heapq.heappop(l) * (-1)
    a = int(a/2)
    if a != 0:
        heapq.heappush(l, a * (-1))
    if len(l) == 0:
        break
    
    
print(sum(l) * (-1))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

n, m = map(int, input().split())
l = [int(n) for n in input().split()]

for j in range(m):
    i =l.index(max(l))
    l[i] = int(l[i]/2)
print(sum(l))

    

Fixed submission:
# coding: utf-8
import heapq

n, m = map(int, input().split())
l = [ -1 * int(n) for n in input().split()]

heapq.heapify(l)

for i in range(m):
    a = heapq.heappop(l) * (-1)
    a = int(a/2)
    if a != 0:
        heapq.heappush(l, a * (-1))
    if len(l) == 0:
        break
    
    
print(sum(l) * (-1))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def fb(num):
    fblist = []
    x, y = 1, 0
    for _ in range(num):
        fblist.append(x)
        x, y = x + y, x
    return fblist



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

l = fb(n)

now = 0
p_cnt = []
for i in range(m):
    a = int(input())
    if now == a:
        print(0)
        exit()
    p_cnt.append(l[a - 1 - now])
    now = a + 1

p_cnt.append(l[n - now])

# print(p_cnt);
ans = 1
for j in range(len(p_cnt)):
    # print(ans)
    ans *= p_cnt[j]
    # print(ans)
    
print(ans %  1000000007)    


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

def fb(num):
    fblist = []
    x, y = 1, 0
    for _ in range(num):
        fblist.append(x)
        x, y = x + y, x
    return fblist

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

l = fb(n + 1)

now = 0
p_cnt = []
for i in range(m):
    a = int(input())
    if now == a:
        print(0)
        exit()
    p_cnt.append(l[a - 1 - now])
    now = a + 1

# print(n)
# print(now)
# print(l)
p_cnt.append(l[n - now])

# print(p_cnt);
ans = 1
for j in range(len(p_cnt)):
    # print(ans)
    ans *= p_cnt[j]
    # print(ans)
    
print(ans %  1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
ok =  [int(i) for i in range(1, n+1)]
answer = 0
for i in range(m):
    a, b = map(int, input().split())
    l = [int(n) for n in range(a, b+1)]
    ok = list(set(ok) & set(l))

print(len(ok))

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

n, m = map(int, input().split())
l = []
r = []
answer = 0
for i in range(m):
    a, b = map(int, input().split())
    l.append(a)
    r.append(b)
min_ok = max(l)
max_ok = min(r)
answer = max_ok - min_ok + 1
if answer < 0:
    answer = 0
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
gate = []
answer = 0
for i in range(m):
    a, b = map(int, input().split())
    gate.append(a)
    gate.append(b)

for k in range(n):
    id = k + 1
    if id < min(gate) or id > max(gate):
        continue
    flg = True
    for l in range(m):
        if id < gate[2 * l] or id > gate[2 * l +1]:
            flg = False
            break 
    if flg:
        answer += 1
print(answer)

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

n, m = map(int, input().split())
l = []
r = []
answer = 0
for i in range(m):
    a, b = map(int, input().split())
    l.append(a)
    r.append(b)
min_ok = max(l)
max_ok = min(r)
answer = max_ok - min_ok + 1
if answer < 0:
    answer = 0
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
gate = []
answer = 0
for i in range(m):
    gate.append([int(j) for j in input().split()])
for k in range(n):
    id = k + 1
    flg = True
    for l in range(m):
        if id < gate[l][0] or id > gate[l][1]:
            flg = False
            break 
    if flg:
        answer += 1
print(answer)

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

n, m = map(int, input().split())
l = []
r = []
answer = 0
for i in range(m):
    a, b = map(int, input().split())
    l.append(a)
    r.append(b)
min_ok = max(l)
max_ok = min(r)
answer = max_ok - min_ok + 1
if answer < 0:
    answer = 0
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
data = input()
l = data.split()
l = list(map(int, l))

points = [l[1] for i in range(l[0])]

for i in range(l[2]):
    a = int(input()) - 1
    for j in range(l[0]):
        if j != a:
            points[j] -= 1

for p in points:
    if p <= 0:
        print("No")
    else:
        print("Yes")


Fixed submission:
data = input()
l = data.split()
l = list(map(int, l))
p = l[1] - l[2]

points = [p for i in range(l[0])]

for i in range(l[2]):
    a = int(input()) - 1
    points[a] += 1

for p in points:
    if p <= 0:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
l = list(map(int, input().split()))
prices = list(map(int, input().split()))

for i in range(l[1]):
    x = prices.index(max(prices))
    prices[x] = int(prices[x] / 2)

print(sum(prices))


Fixed submission:
import heapq

N, M = map(int, input().split())
values = list(map(int, input().split()))
sortedValues = []

for v in values:
    heapq.heappush(sortedValues, (-1)*v)

for i in range(M):
    heapq.heappush(sortedValues, int((heapq.heappop(sortedValues) * 1/2)))

print((-1) * sum([heapq.heappop(sortedValues) for i in range(len(sortedValues))]))

Buggy python submission (verdict: Time Limit Exceeded):

l = list(map(int, input().split()))
prices = list(map(int, input().split()))

for i in range(l[1]):
    #prices.sort(reverse = True)
    x = prices.index(max(prices))
    prices[x] = int(prices[x] / 2)

print(sum(prices))


Fixed submission:
import heapq

N, M = map(int, input().split())
values = list(map(int, input().split()))
sortedValues = []

for v in values:
    heapq.heappush(sortedValues, (-1)*v)

for i in range(M):
    heapq.heappush(sortedValues, int((heapq.heappop(sortedValues) * 1/2)))

print((-1) * sum([heapq.heappop(sortedValues) for i in range(len(sortedValues))]))

Buggy python submission (verdict: Time Limit Exceeded):

l = list(map(int, input().split()))
prices = list(map(int, input().split()))

for i in range(l[1]):
    prices.sort(reverse = True)
    prices[0] = int(prices[0] / 2)

print(sum(prices))


Fixed submission:
import heapq

N, M = map(int, input().split())
values = list(map(int, input().split()))
sortedValues = []

for v in values:
    heapq.heappush(sortedValues, (-1)*v)

for i in range(M):
    heapq.heappush(sortedValues, int((heapq.heappop(sortedValues) * 1/2)))

print((-1) * sum([heapq.heappop(sortedValues) for i in range(len(sortedValues))]))

Buggy python submission (verdict: Time Limit Exceeded):
data = input()
l = data.split()
l = list(map(int, l))
N, M = l[0], l[1]

s = input()
prices = s.split()
prices = list(map(int, prices))

#prices.sort(reverse = True)
#print(prices)

for i in range(M): #　半額券の数だけループ
    prices.sort(reverse = True)
    prices[0] = int(prices[0] / 2)

print(sum(prices))


Fixed submission:
import heapq

N, M = map(int, input().split())
values = list(map(int, input().split()))
sortedValues = []

for v in values:
    heapq.heappush(sortedValues, (-1)*v)

for i in range(M):
    heapq.heappush(sortedValues, int((heapq.heappop(sortedValues) * 1/2)))

print((-1) * sum([heapq.heappop(sortedValues) for i in range(len(sortedValues))]))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
i = 0
count = 0
if b == 1:
    print(0)
else:
    while count < b:
    i += 1
    count = i*a-(i-1)
    
    else:
        print(i)

Fixed submission:
a, b = map(int, input().split())
i = 0
count = 0
if b == 1:
    print(0)
else:
    while count < b:
        i += 1
        count = i*a-(i-1)
    
    else:
        print(i)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, imput().split())

if c > a-b:
    ans = c-a+b
else:
    ans = 0

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

if c > a-b:
    ans = c-a+b
else:
    ans = 0
print(ans)