Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#%%
a = input()
#b = input()

A = [int(x) for x in a.split()]

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

gcb = math.gcd(A[0], A[1])  # 最大公約数

#%%
def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

so_gcb = prime_factorize(gcb)


#%%
new_num = []
for num in so_gcb:
    if num not in new_num:
        new_num.append(num)

print(len(new_num))

Fixed submission:
#%%
a = input()
#b = "2 3 1"
#%%
A = [int(x) for x in a.split()]

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

import fractions
gcb = fractions.gcd(A[0], A[1])  # 最大公約数

#%%
def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

so_gcb = prime_factorize(gcb)


#%%
new_num = []
for num in so_gcb:
    if num not in new_num:
        new_num.append(num)

print(len(new_num))

Buggy python submission (verdict: Runtime Error):
#%%
a = input()
#b = input()

#%%
#a = "12 18"
#b = "2 3 1"
#%%
A = [int(x) for x in a.split()]

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

gcb = math.gcd(A[0], A[1])  # 最大公約数

#%%
def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

so_gcb = prime_factorize(gcb)


#%%
new_num = []
for num in so_gcb:
    if num not in new_num:
        new_num.append(num)

print(len(new_num))

Fixed submission:
#%%
a = input()
#b = "2 3 1"
#%%
A = [int(x) for x in a.split()]

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

import fractions
gcb = fractions.gcd(A[0], A[1])  # 最大公約数

#%%
def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

so_gcb = prime_factorize(gcb)


#%%
new_num = []
for num in so_gcb:
    if num not in new_num:
        new_num.append(num)

print(len(new_num))
Buggy python submission (verdict: Time Limit Exceeded):

N, K = map(int, input().split())
key_data_list = []
for _ in range(K):
    value, op = map(int, input().split())
    open_boxes = map(int, input().split())
    box_value = 0
    for opb in open_boxes:
      box_value += 2**(opb-1)
    key_data_list.append([value, box_value])

import numpy as np

max_tresure_state = 2**N
max_key_price = 2**30
dp_table = np.full((K+1,max_tresure_state),max_key_price)

dp_table[0][0] = 0

for key_index in range(K):
    for tresure_state in range(max_tresure_state):
        key_value = key_data_list[key_index][0]
        key_state = key_data_list[key_index][1]

        if dp_table[key_index+1][tresure_state] > dp_table[key_index][tresure_state]:
            dp_table[key_index+1][tresure_state] = dp_table[key_index][tresure_state]

        buying_state = key_state | tresure_state
        dp_table[key_index+1][buying_state] = min(dp_table[key_index][buying_state],
                                                  dp_table[key_index+1][buying_state],
                                                  dp_table[key_index][tresure_state] + key_value)


result_value = dp_table[K][max_tresure_state-1]
if result_value == max_key_price:
    print(-1)
else:
    print(int(result_value))


Fixed submission:

N, K = map(int, input().split())
key_data_list = []
for _ in range(K):
    value, op = map(int, input().split())
    open_boxes = map(int, input().split())
    box_value = 0
    for opb in open_boxes:
      box_value += 2**(opb-1)
    key_data_list.append([value, box_value])

max_tresure_state = 2**N
max_key_price = 2**30
dp_table = [[max_key_price] * (max_tresure_state) for i in range(K+1)]

dp_table[0][0] = 0

for key_index in range(K):
    for tresure_state in range(max_tresure_state):
        key_value = key_data_list[key_index][0]
        key_state = key_data_list[key_index][1]

        if dp_table[key_index+1][tresure_state] > dp_table[key_index][tresure_state]:
            dp_table[key_index+1][tresure_state] = dp_table[key_index][tresure_state]

        buying_state = key_state | tresure_state
        dp_table[key_index+1][buying_state] = min(dp_table[key_index][buying_state],
                                                  dp_table[key_index+1][buying_state],
                                                  dp_table[key_index][tresure_state] + key_value)


result_value = dp_table[K][max_tresure_state-1]
if result_value == max_key_price:
    print(-1)
else:
    print(int(result_value))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy

N,K,Q = map(int, input().split())

point = numpy.full(N, K)
lose_point = numpy.ones(N)
for _ in range(Q):
    winnner = int(input())
    point -= lose_point
    point[winnner-1] += 1

for p in point:
    if(p>0):
        print('Yes')
    else:
        print('No')


Fixed submission:
N,K,Q = map(int, input().split())

point = [0] * N
for _ in range(Q):
    winnner = int(input())
    point[winnner-1] += 1

for p in point:
    if(p>Q-K):
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int, input().split())

point = [K] * N
for _ in range(Q):
    winnner = int(input())
    for idx in range(N):
        point[idx] -= 1
    point[winnner-1] += 1

for p in point:
    if(p>0):
        print('Yes')
    else:
        print('No')


Fixed submission:
N,K,Q = map(int, input().split())

point = [0] * N
for _ in range(Q):
    winnner = int(input())
    point[winnner-1] += 1

for p in point:
    if(p>Q-K):
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):


N,K,Q = map(int, input().split())

point = [K] * N
for _ in range(Q):
    winnner = int(input())
    lose_point = [1] * N
    lose_point[winnner-1] = 0
    point = [x-y for (x,y) in zip(point,lose_point)]

for p in point:
    if(p>0):
        print('Yes')
    else:
        print('No')


Fixed submission:
N,K,Q = map(int, input().split())

point = [0] * N
for _ in range(Q):
    winnner = int(input())
    point[winnner-1] += 1

for p in point:
    if(p>Q-K):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):

N, M = map(int, input().split())
A = [int(x) for x in input().split()]

dp = [[0]*(M+1) for _ in range(N+1)]

for product_num in range(N):
    for ticket_num in range(M+1):
        price_caditate_list = []
        for use_num in range(ticket_num+1):
            price_caditate_list.append(dp[product_num][ticket_num-use_num] + (A[product_num]>>use_num))
        dp[product_num+1][ticket_num] = min(price_caditate_list)

print(dp[N][M])


Fixed submission:
N, M = map(int, input().split())
A = [-int(x) for x in input().split()]

import heapq
heapq.heapify(A)

for ticket_num in range(1,M+1):
    max_value = -1*heapq.heappop(A)
    heapq.heappush(A, -1*(max_value>>1))

print(-1*sum(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

left = 0
right = 1
max_length = 0

while left < N:
    if right - left > N - right:
        break
    if S[left:right] in S[right:]:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1

print(max_length)


Fixed submission:
N = int(input())
S = input()

left = 0
right = 1
max_length = 0

while left < N:
    if right - left > N - right:
        break
    serch_str = S[left:right]
    if serch_str in S[right:]:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1

print(max_length)

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

left = 0
right = 1
max_length = 0

while left < N:
    if right - left > N - right:
        break
    serch_str = S[left:right]
    left_str = S[right:]
    if serch_str in left_str:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1
        right = left + 1

print(max_length)

Fixed submission:
N = int(input())
S = input()

left = 0
right = 1
max_length = 0

while left < N:
    if right - left > N - right:
        break
    serch_str = S[left:right]
    if serch_str in S[right:]:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1

print(max_length)

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

left = 0
right = 1
max_length = 0

while left < N:
    serch_str = S[left:right]
    left_str = S[right:]
    if serch_str in left_str:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1
        right = left + 1

print(max_length)



Fixed submission:
N = int(input())
S = input()

left = 0
right = 1
max_length = 0

while left < N:
    if right - left > N - right:
        break
    serch_str = S[left:right]
    if serch_str in S[right:]:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1

print(max_length)

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

left = 0
right = 1
max_length = 0

while left < N:
    serch_str = S[left:right]
    left_str = S[right:]
    if serch_str in left_str:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1
        right = left + 1

print(max_length)


Fixed submission:
N = int(input())
S = input()

left = 0
right = 1
max_length = 0

while left < N:
    if right - left > N - right:
        break
    serch_str = S[left:right]
    if serch_str in S[right:]:
        max_length = max(max_length, len(serch_str))
        right += 1
    else:
        left += 1

print(max_length)
Buggy python submission (verdict: Time Limit Exceeded):

def main():
    S = input()

    modN = 13
    modAns = 10**9+7
    dp_table = [[0 for idx in range(modN)] for _ in range(len(S)+1)]
    dp_table[0][0] = 1

    for digit in range(len(S)):
        if S[digit] == '?':
            for mod in range(modN):
                for add_num in range(10):
                    next_mod = (10*mod + add_num) % 13
                    dp_table[digit+1][next_mod] += dp_table[digit][mod]
        else:
            val = int(S[digit])
            for mod in range(modN):
                next_mod = (10*mod + val) % 13
                dp_table[digit+1][next_mod] += dp_table[digit][mod]
        for idx in range(modN):
            dp_table[digit+1][idx] %= modAns

    print(dp_table[-1][5])


if __name__ == "__main__":
    main()


Fixed submission:

def main():
    S = input()

    modN = 13
    modAns = 10**9+7
    dp_table = [[0 for idx in range(modN)] for _ in range(len(S)+1)]
    dp_table[0][0] = 1

    for digit in range(len(S)):
        if S[digit] == '?':
            for mod in range(modN):
                for add_num in range(10):
                    next_mod = (10*mod + add_num) % 13
                    dp_table[digit+1][next_mod] += dp_table[digit][mod]
        else:
            val = int(S[digit])
            for mod in range(modN):
                next_mod = (10*mod + val) % 13
                dp_table[digit+1][next_mod] += dp_table[digit][mod]
        for idx in range(modN):
            dp_table[digit+1][idx] %= modAns

    print(dp_table[-1][5])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

cnt = 1

for i in range(1, N):
  if P[i] == min(P[:i+1]):
    cnt += 1
print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = tuple(map(int, input().split()))

cnt = 1
min = N

for i in range(1, N):
  if P[i] > min:
    continue
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    if min >P[i]:
      min = P[i]
    cnt += 1
    if min == 1:
      break
    if i < P.index(P[i]-1):
      i = P.index(P[i]-1)
      i -= 1


print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = tuple(map(int, input().split()))

cnt = 1
min = N

for i in range(1, N):
  if P[i] > min:
    continue
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    if min >P[i]:
      min = P[i]
    cnt += 1
    if min == 1:
      break


print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)

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

cnt = 1
min = N

for i in range(1, N):
  if P[i] > min:
    continue
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    if min >P[i]:
      min = P[i]
    cnt += 1
    if min == 1:
      break


print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)

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

cnt = 1

for i in range(1, N):
  for j in range(i-1, -1, -1):
    if P[i] > P[j]:
      break
  else:
    cnt += 1


print(cnt)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
min_p = P[0]
cnt = 0

for p in P:
  if p <= min_p:
    min_p = p
    cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
l = input().split(" ")
N = int(l[0])
M = int(l[1])

answered = set()

ac_count = 0
wa_count = 0

for n in range(M):
    result = [i for i in input().split(" ")]
    p = result[0]
    if p in answered:
        continue
    s = result[1]
    if s == "WA":
        wa_count += 1
    else:
        ac_count += 1
        answered.add(p)
        if len(answered) == N:
            break

print(ac_count, wa_count)

Fixed submission:
ord_s = ord(input())

chr_s = chr(ord_s+1)
print(chr_s)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def main():
    l = input().rstrip().split(' ')
    
    x = int(l[0])
    y = int(l[1])
    
    print(lcm(x, y))
    
if __name__ == "__main__":
    main()

Fixed submission:
#最大公約数、最小公倍数
import fractions
a,b=map(int, input().split())
f=fractions.gcd(a,b)
f2=a*b//f
print(f2)

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

l = input().rstrip().split(' ')

x = int(l[0])
y = int(l[1])

print(lcm(x, y))

Fixed submission:
#最大公約数、最小公倍数
import fractions
a,b=map(int, input().split())
f=fractions.gcd(a,b)
f2=a*b//f
print(f2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = input().split()

ans_list = []

for i in range(1, N+1):
  ans_list.append(str(l.index(str(i))+1))

l = " ".join(ans_list)
  
print(l)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i, a in enumerate(A):
    ans[a-1] = i+1

print(*ans)

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

student_list = input().rstrip().split(' ')

answer = ""

for n in range(1, N+1):
  i = student_list.index(str(n))
  answer += str(i+1) + " "
  
print(answer[0:-1])


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i, a in enumerate(A):
    ans[a-1] = i+1

print(*ans)

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

student_list = input().rstrip().split(' ')

answer = ""

for n in range(N):
  i = student_list.index(str(n+1))
  answer += str(i+1) + " "
  
print(answer[0:-1])


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i, a in enumerate(A):
    ans[a-1] = i+1

print(*ans)

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

student_list = input().rstrip().split(' ')

ans_list = []

for n in range(N):
  i = student_list.index(str(n+1))
  ans_list.append(str(i+1))
  
print(' '.join(ans_list))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * N
for i, a in enumerate(A):
    ans[a-1] = i+1

print(*ans)
Buggy python submission (verdict: Runtime Error):
B = int(s[1])
 
sum = A
cnt = 1
flg = True
 
while flg:
  if B ==0 or B == 1:
    cnt = 0
    break
  if sum >= B:
    break
  sum += A -1
  cnt += 1
 
print(cnt)

Fixed submission:
s = input().rstrip().split(' ')
A = int(s[0])
B = int(s[1])
 
sum = A
cnt = 1
flg = True
 
while flg:
  if B ==0 or B == 1:
    cnt = 0
    break
  if sum >= B:
    break
  sum += A -1
  cnt += 1
 
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = (L*(L+1)) % 2019
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
        if cnt == 0:
          print(0)
        	exit()   
print(cnt)


Fixed submission:
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = 2020
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
            if cnt == 0:
        	    break
    if cnt == 0:
      break
 
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = (L*(L+1)) % 2019
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
            if cnt == 0:
        	    break
    if cnt == 0:
      break
 
print(cnt)

Fixed submission:
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = 2020
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
            if cnt == 0:
        	    break
    if cnt == 0:
      break
 
print(cnt)

Buggy python submission (verdict: Runtime Error):
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = (L*(L+1)) % 2019
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
        	if cnt == 0:
    			break
    if cnt == 0:
      break

print(cnt)

Fixed submission:
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = 2020
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
            if cnt == 0:
        	    break
    if cnt == 0:
      break
 
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = (L*(L+1)) % 2019

for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
    
print(cnt)


Fixed submission:
s = input().rstrip().split(' ')
L = int(s[0])
R = int(s[1])
cnt = 2020
 
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if ans < cnt:
            cnt = ans
            if cnt == 0:
        	    break
    if cnt == 0:
      break
 
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d_list = [int(i) for i in input().rstrip().split(' ')]

cnt = 0

for i in range(1, max(d_list)+1):
  cnt_low = 0
  cnt_high = 0
  for d in d_list:
    if i >= d:
      cnt_high += 1
    else:
      cnt_low += 1

  if cnt_high == cnt_low:
    cnt += 1
      
print(cnt)

Fixed submission:
n = int(input())
d_list = [int(i) for i in input().rstrip().split(' ')]
d_list.sort()

a = int(n/2) -1
b = int(n/2)

if d_list[a] == d_list[b]:
  print(0)
else:
  print(d_list[b] - d_list[a])
Buggy python submission (verdict: Runtime Error):
s=input()
if s[0]=='S':
    print('Cloudy')
else if s[0]=='C':
    print('Rainy')
else:
    print('Suuny')

    

Fixed submission:
s=input()
if s[0]=='S':
    print('Cloudy')
elif s[0]=='C':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
S = input()
T = 0
K = len(S)/2 if len(S)%2 == 0 else len(S)//2+1
for i in range(len(S)//2):
  if S[i] != S[K + i]:
    T+=1
print(T)

Fixed submission:
S = input()
T = 0
for i in range(len(S)//2):
  if S[i] != S[len(S) -1 -i]:
    T+=1
print(T)

Buggy python submission (verdict: Runtime Error):
S = input()
T = 0
K = len(S)//2 if len(S)%2 == 0 else len(S)//2+1
for i in range(K):
  if S[i] != S[K + i]:
    T+=1
print(T)

Fixed submission:
S = input()
T = 0
for i in range(len(S)//2):
  if S[i] != S[len(S) -1 -i]:
    T+=1
print(T)

Buggy python submission (verdict: Runtime Error):
S = input()
T = 0
for i in range(len(S)//2):
  if S[i] != S[K//2 + i +1]:
    T+=1
print(T)

Fixed submission:
S = input()
T = 0
for i in range(len(S)//2):
  if S[i] != S[len(S) -1 -i]:
    T+=1
print(T)

Buggy python submission (verdict: Runtime Error):
S = input()
T = 0
for i in range(len(S)//2):
  if S[i] == S[len(S)//2 + 1]:
    T+=1
print(T)

Fixed submission:
S = input()
T = 0
for i in range(len(S)//2):
  if S[i] != S[len(S) -1 -i]:
    T+=1
print(T)
Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A < 2*B:
  print(0)
else:
  print(A-2B)

Fixed submission:
A,B=map(int, input().split())
if A < 2*B:
  print(0)
else:
  print(A-2*B)
Buggy python submission (verdict: Runtime Error):
N,Y=map(int,input().split())
for i in range(N+1):
  for k range(N+1-i):
    int m = N-i-k
    if 10000*i + 5000*k + 1000*m == Y:
      print(i k m)
      exit()
print('-1' '-1' '-1')

Fixed submission:
N,Y=map(int,input().split())
for i in range(N+1):
  for k in range(N+1-i):
    m = N-i-k
    if 10000*i + 5000*k + 1000*m == Y:
      print(i,k,m)
      exit()
print(-1,-1,-1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
money = int(input())
Y = money//(10**4)
H = money//(10**3)
N = money//(10**2)
for i in range(Y+1):
  for k in range(H+1):
    for m in range(N+1):
       if money = (10**4)*i +(10**3)*k+(10**2)*m:
          print(i,k,m,sep=" ")
        
      

Fixed submission:
N,Y=map(int,input().split())
for i in range(N+1):
  for k in range(N+1-i):
    m = N-i-k
    if 10000*i + 5000*k + 1000*m == Y:
      print(i,k,m)
      exit()
print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
S = list(range(N+1).split(''))
print(S)

Fixed submission:
N,A,B=map(int,input().split())
E = 0
def ans(N):
  K = str(N)
  T = list(map(int,K))
  return (sum(T)) 
  
S = list(range(N+1))
for i in S:
  num = ans(S[i])
  if num >= A and num <= B:
    E += S[i]
print(E)