Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03417 (python)

Fixed submission:
N, M = map(int, input().split())
if ((N - 2) == 0) or ((M - 2) == 0):
    result = 0
elif N == M == 1:
    result = 1
elif N == 1:
    result = M - 2
elif M == 1:
    result = N - 2
else:
    result = (N - 2) * (M - 2)
print(result)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
reverse = [1]*(N*M)
num1 = [-M-1, -M, -M+1, -1, 1, M-1, M, M+1]
num2 = [-M, -M+1, 1, M, M+1]
num3 = [-M-1, -M, -1, M-1, M]
if N == M == 1:
    reverse[0] *= -1
else:
    for i in range(N*M):
        reverse[i] *= -1
        if (i % M) == 0:
            num = num2
        elif ((i + 1) % M) == 0:
            num = num3
        else:
            num = num1
        for j in num:
            if ((i + j) >= 0) and ((i + j) < (N * M)):
                reverse[i+j] *= -1
print(reverse.count(-1))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
reverse = [1]*(N*M)
num1 = [-M-1, -M, -M+1, -1, 1, M-1, M, M+1]
num2 = [-M, -M+1, 1, M, M+1]
num3 = [-M-1, -M, -1, M-1, M]
for i in range(N*M):
    #print(i, reverse)
    reverse[i] *= -1
    if (i % M) == 0:
        num = num2
    elif ((i + 1) % M) == 0:
        num = num3
    else:
        num = num1
    for j in num:
        if ((i + j) >= 0) and ((i + j) < (N * M)):
            reverse[i+j] *= -1
    #print(reverse)
#print(num)
#print(reverse)
print(reverse.count(-1))
Problem p03037 (python)

Fixed submission:
import sys
idCards, gates = input().split(" ")
idCards = int(idCards)
gates = int(gates)
minNum = []
maxNum = []

if idCards > 1000000 or gates > 1000000:
    sys.exit()

for count in range(0, gates, 1):
    num1, num2 = input().split(" ")
    minNum.append(int(num1))
    maxNum.append(int(num2))

minId = max(minNum)
maxId = min(maxNum)
if minId > maxId:
    print("0")
else:
    print((maxId - minId) + 1)

Buggy submission (verdict: Runtime Error):
idCards, gates = input().split(" ")
idCards = int(idCards)
gates = int(gates)

for count in range(0, gates, 1):
    num1, num2 = input().split(" ")
    minNum.append(int(num1))
    maxNum.append(int(num2))

minId = max(minNum)
maxId = min(maxNum)
if minId > maxId:
    print("0")
else:
    print((maxId - minId) + 1)
Problem p03387 (python)

Fixed submission:
num1, num2, num3 = input().split(" ")
numList = [int(num1),int(num2),int(num3)]
numList.sort(reverse=True)
maxNum = numList[0]
midNum = numList[1]
minNum = numList[2]

count = 0
if maxNum % 2 == 0:
    if midNum % 2 == 0 and minNum % 2 == 0:
        count += (midNum - minNum) // 2
        count += (maxNum - midNum)
    elif midNum % 2 == 1 and minNum % 2 == 1:
        maxNum += 2
        midNum += 2
        midNum += 2
        count += (midNum - minNum) // 2
        count += (maxNum - midNum)
        count += 2
    else:
        if midNum % 2 == 0:
            maxNum += 1
            minNum += 1
            count += (midNum - minNum) // 2
            count += (maxNum - midNum)
            count += 1
        else:
            maxNum += 1
            midNum += 1
            count += (midNum - minNum) // 2
            count += (maxNum - midNum)
            count += 1
else:
    if midNum % 2 == 0 and minNum % 2 == 0:
        count += (midNum - minNum) // 2
        count += (maxNum - midNum)
    elif midNum % 2 == 1 and minNum % 2 == 1:
        count += (midNum - minNum) // 2
        count += (maxNum - midNum)
    else:
        if midNum % 2 == 0:
            maxNum += 1
            minNum += 1
            count += (midNum - minNum) // 2
            count += (maxNum - midNum)
            count += 1
        else:
            maxNum += 1
            midNum += 1
            count += (midNum - minNum) // 2
            count += (maxNum - midNum)
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
num1, num2, num3 = input().split(" ")
numList = [int(num1),int(num2),int(num3)]
numList.sort(reverse=True)
maxNum = numList[0]
midNum = numList[1]
minNum = numList[2]

count = 0

def check():
    count += (midNum - minNum) // 2
    count += (maxNum - midNum)

if midNum % 2 == 0 and minNum % 2 == 0:
    #count += (midNum - minNum) // 2
    #count += (maxNum - midNum)
    check()
elif midNum % 2 == 1 and minNum % 2 == 1:
    if maxNum % 2 == 0:
        maxNum += 2
        midNum += 2
        midNum += 2
        #count += (midNum - minNum) // 2
        #count += (maxNum - midNum)
        check()
        count += 2
    else:
        check()
        #count += (midNum - minNum) // 2
        #count += (maxNum - midNum)
else:
    if midNum % 2 == 0:
        maxNum += 1
        minNum += 1
        check()
        #count += (midNum - minNum) // 2
        #count += (maxNum - midNum)
        count += 1
    else:
        maxNum += 1
        midNum += 1
        check()
        #count += (midNum - minNum) // 2
        #count += (maxNum - midNum)
        count += 1
print(count)
Problem p02999 (python)

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

if X >= A :
    print(10)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))

bound = [0]
for i in range(N):
    bound += [L[i] + bound[-1]]
    #print(bound)

#print(bound)

counter = 0
for i in bound:
    if i <= X:
        counter += 1
    else:
        break
print(counter)
Problem p03071 (python)

Fixed submission:
button = input().split()
A = int(button[0])
B = int(button[1])


if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())


if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())


if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

Buggy submission (verdict: Runtime Error):
A = int(input())
B =int(input())

if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)

Buggy submission (verdict: Runtime Error):
A = int(input("数字を入力してください:"))
B =int(input("数字を入力:"))

if A > B:
    print(A + A - 1)

elif A == B:
    print(A + B)

else:
    print(B + B -1)
Problem p02995 (python)

Fixed submission:
import copy
import fractions

inp = input()
# inp = "314159265358979323 846264338327950288 419716939 937510582"
inp = inp.split(" ")
a = int(inp[0])
b = int(inp[1])
c = int(inp[2])
d = int(inp[3])

h = c * d // fractions.gcd(c, d)
e = int(b // c) - int((a-1) // c)
f = int(b // d) - int((a-1) // d)
g = int(b // h) - int((a-1) // h)

print((b-a+1)-(e+f-g))

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

inp = str(input())
# inp = "314159265358979323 846264338327950288 419716939 937510582"
inp = inp.split(" ")
a = int(inp[0])
b = int(inp[1])
c = int(inp[2])
d = int(inp[3])

h = c * d / math.gcd(c, d)
e = int(b / c) - int((a-1) / c)
f = int(b / d) - int((a-1) / d)
g = int(b / h) - int((a-1) / h)

print((b-a+1)-(e+f-g))

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

inp = str(input())
# inp = "314159265358979323 846264338327950288 419716939 937510582"
inp = inp.split(" ")
a = int(inp[0])
b = int(inp[1])
c = int(inp[2])
d = int(inp[3])

h = c * d / math.gcd(c, d)
e = int(b / c) - int((a-1) / c)
f = int(b / d) - int((a-1) / d)
g = int(b / h) - int((a-1) / h)

print((b-a+1)-(e+f-g))
Problem p03379 (python)

Fixed submission:
import copy
N = int(input())
numList = list(map(int, input().split()))
numListCopy = copy.deepcopy(numList)
numList = sorted(numList)
medIndex = int((N)/2)
med1 = numList[medIndex-1]
med2 = numList[medIndex]


for i in range(0,N):
	if numListCopy[i] <= med1:
		print(med2)
	elif med2 <= numListCopy[i]:
		print(med1)

Buggy submission (verdict: Runtime Error):
import copy
N = int(input())
numList = list(map(int, input().split()))
medIndex = int(N/2)

for i in range(0,N):
	numListCopy = copy.deepcopy(numList)
	numListCopy.pop(i)
	numListCopy.sort()
	print(numListCopy[medIndex])
Problem p03024 (python)

Fixed submission:
import sys
s = sys.stdin.readline().rstrip()
if len([y for y in s if y == 'x']) >= 8:
  print('NO')
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
import sys
s = sys.stdin.readline().rstrip()
if len([y for y in s if y == 'x']) >= 8::
  print('NO')
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
import sys
s = sys.stdin.readline().rstrip()
if sum([y for y in s if y == 'o']) >= 8:
  print('YES')
else:
  print('NO')
Problem p04039 (python)

Fixed submission:
import collections, heapq, math, sys

n, k = map(int, sys.stdin.readline().rstrip().split(' '))
dislikes = map(int, sys.stdin.readline().rstrip().split(' '))
dislikess= set(dislikes)
for i in range(9):
  if i not in dislikess:
    smallest = i
    break
cp = n
s = []
while cp:
  s.append(cp%10)
  cp //= 10
s.append(0)
idx = -1
found = True
for i in range(len(s)):
  z = s[i]
  if i == len(s) - 1:
    if not found:
        if smallest == 0:
            for m in range(1, 10):
                if m not in dislikess:
                    s[i] = m
                    break
        else:
            s[i] = smallest
        idx = i-1
    break
  if not found or z in dislikess:
    found = False
    for j in range(z+1, 10):
      if j not in dislikes:
        s[i] = j
        found = True
        break
    if not found:
    	idx = i
    else:
    	idx = i - 1
  else:
    found = True
if s[-1] == 0:
  s.pop()
for i in range(idx+1):
  s[i] = smallest

ret = 0
while len(s):
  ret *= 10
  ret += s.pop()
print(ret)

Buggy submission (verdict: Runtime Error):
import collections, heapq, math, sys

n, k = map(int, sys.stdin.readline().rstrip().split(' '))
dislikes = map(int, sys.stdin.readline().rstrip().split(' '))
dislikess= set(dislikes)
for i in range(9):
  if i not in dislikess:
    smallest = i
    break
cp = n
s = []
while cp:
  s.append(cp%10)
  cp //= 10
s.append(0)
idx = -1
found = True
for i in range(len(s)):
  z = s[i]
  if i == len(s) - 1 and not found:
    s[i] = smallest
    idx = i-1
    break
  if not found or z in dislikess:
    found = False
    for j in range(z+1, 10):
      if j not in dislikes:
        s[i] = j
        found = True
        break
    if not found:
    	idx = i
    else:
    	idx = i - 1
  else:
    found = True
if s[-1] == 0:
  s.pop()
for i in range(idx+1):
  s[i] = smallest

ret = 0
while len(s):
  ret *= 10
  ret += s.pop()
print(ret)
Problem p03030 (python)

Fixed submission:
n = int(input())

res = []
for i in range(n):
    s, s_p = input().split()
    p = int(s_p)
    res.append(((s, -p), i + 1))

res.sort(key=lambda r: r[0])

for r in res:
    print(r[1])

Buggy submission (verdict: Runtime Error):
n = int(input())
res = list(enumerate(((s[0], int(s[1])) for s in input().split()), 1))

res.sort(key=lambda r: r[1])

[print(r[0]) for r in res]
Problem p02995 (python)

Fixed submission:
# coding: utf-8
a, b, c, d = [int(i) for i in input().split()]
c1 = d if c < d else c
d1 = c if c < d else d
while d1 != 0:
    e = d1
    d1 = c1 % d1
    c1 = e
e = int((c * d) / e)
a -= 1
cnt = (b - a) + int(b // e) - int(a // e) - int(b // c) + int(a // c) - int(b // d) + int(a // d)
print(cnt)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
a, b, c, d = [int(i) for i in input().split()]
c1, d1 = [d if c < d else c, c if c < d else d]
while d1 > 1:
    e = d1
    d1 = c1 % d1
    c1 = e
e = c * d / e
cnt = (b - a + 1) + int(b / e) - int(a / e) - int(b / c) + int(a / c) - int(b / d) + int(a / d)
print(cnt)
Problem p03024 (python)

Fixed submission:

s = input()
a = 0

for i in s:
    a += 1 if i == 'o' else 0

if a + 15 - len(s) >= 8:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):

print('YES' if len(s = input()) - s.count('o') <= 7 else 'NO')
Problem p03160 (python)

Fixed submission:
inf = 1e10
n = int(input())
h = [int(i) for i in input().split()]
dp = [inf]*n
for i in range(n):
    if i == 0:
        dp[i] = 0
    elif i == 1:
        dp[i] = abs(h[i-1]-h[i])
    else:
        dp[i] = min(dp[i-1]+abs(h[i-1]-h[i]), dp[i-2]+abs(h[i-2]-h[i]))
print(dp[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = (int(i) for i in input().split())
x, y = 0, abs(h[0]-h[1])
for i in range(2, n):
    v = min(x+abs(h[i-2]-h[i]), y+abs(h[i-1]-h[i]))
    x, y = y, v
print(y)

Buggy submission (verdict: Runtime Error):
N = int(input())

H = [int(i) for i in input().split()]

def cost(n):
    if n == 1:
        return 0
    if n == 2:
        return abs(H[0]-H[1])
    return min(cost(n-1)+abs(H[n-2]-H[n-1]), cost(n-2)+abs(H[n-3]-H[n-1]))

print(cost(N))
Problem p03155 (python)

Fixed submission:
from math import *
log = lambda *x: print(*x)

def cin(*fn, def_fn=str):
    i, r = 0, []
    if fn:
        def_fn = fn[0]
    for c in input().split(' '):
        r += [(fn[i] if len(fn) > i else def_fn) (c)]
        i += 1
    return r
##################################################

n, = cin(int)
h, = cin(int)
w, = cin(int)

tw, th = 0, 0

while h <= n:
    h += 1
    th += 1

while w <= n:
    tw += 1
    w += 1

log(th * tw)

Buggy submission (verdict: Runtime Error):
from math import *
log = lambda *x: print(*x)

n, = cin(int)
h, = cin(int)
w, = cin(int)

tw, th = 0, ceil(n/h)

while w <= n:
    tw += 1
    w += 1

log(th * tw)

Buggy submission (verdict: Runtime Error):
# from sys import stdout
# from math import *
# from math import log as lg
# from bisect import bisect_left as bs
log = lambda *x: print(*x)

def cin(*fn, def_fn=str):
    i, r = 0, []
    if fn:
        def_fn = fn[0]
    for c in input().split(' '):
        r += [(fn[i] if len(fn) > i else def_fn) (c)]
        i += 1
    return r
##################################################

n,h,w = cin(int)

log(round(n/h) * round(n/h))
Problem p03697 (python)

Fixed submission:
a,b=[int(x) for x in input().split(' ')]
print("error" if a+b>=10 else a+b)

Buggy submission (verdict: Runtime Error):
a,b=int(x) for x in input().split(' ')
print("error" if a+b>=10 else a+b)
Problem p03244 (python)

Fixed submission:
import collections
n = int(input())
v = list(map(int, input().split()))
ve = v[0::2]
vo = v[1::2]
# print(ve,vo)

ce=collections.Counter(vo).most_common(2)
co=collections.Counter(ve).most_common(2)

if(ce[0][0] != co[0][0]):
    ans = len(v) - ce[0][1] - co[0][1]
elif(len(ce)==1 and len(co)==1):
    ans = len(v) // 2
elif(len(ce)==1):
    ans = len(v) // 2 - co[1][1]
elif(len(co)==1):
    ans = len(v) // 2 - ce[1][1]
else:
    ans = len(v) - max( ce[0][1]+co[1][1], ce[1][1]+co[0][1])

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
v = list(map(int, input().split()))
ve = v[0::2]
vo = v[1::2]
# print(ve,vo)

ce=collections.Counter(vo).most_common(2)
co=collections.Counter(ve).most_common(2)

if(ce[0][0] != co[0][0]):
    ans = len(v) - ce[0][1] - co[0][1]
elif(len(ce)==1 and len(co)==1):
    ans = len(v) // 2
elif(len(ce)==1):
    ans = len(v) // 2 - co[1][1]
elif(len(co)==1):
    ans = len(v) // 2 - ce[1][1]
print(ans)
Problem p03001 (python)

Fixed submission:
T,Y,x,y=map(int,input().split())
a='0'
if T/2==x and Y/2==y:
  a='1'
print(T*Y/2,a)

Buggy submission (verdict: Runtime Error):
T,Y,x,y=map(int,input().split())
a='0'
if T/2==x & Y/2==y:
  a='1'
print(T*Y/2,a)

Buggy submission (verdict: Runtime Error):
T,Y,x,y=map(int,input().split())
a='0'
if T/2=x & Y/2=y:
  a='1'
print(T*Y/2,a)
Problem p03029 (python)

Fixed submission:
a,b=map(int,input().split())
c=(3*a+b)/2
import math
print(math.floor(c))

Buggy submission (verdict: Runtime Error):
a,b=map(input().split())
print((3*a+b)/2)
Problem p03308 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A.sort()
print(A[N-1]-A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort()
print(A[N]-A[0])
Problem p03309 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
  B.append(A[i]-(i+1))
B.sort()
if N%2==0:
  a=N/2
  b=int((B[int(a)]+B[int(a-1)])/2)
else:
  a=(N+1)/2
  b=B[int(a-1)]
for i in range(N):
  B[i]=abs(B[i]-b)
print(sum(B))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
  B.append(A[i]-(i+1))
B.sort()
if N%2==0:
  a=N/2
else:
  a=(N+1)/2
b=B[a-1]
for i in range(N):
  B[N-1]=abs(B[N-1]-b)
print(B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
B.sort()
A_max=B[N-1]
sum_A=[0]*(A_max+1)
for i in range(A_max+1):
  for num in range(N):
    sum_A[i]+=abs(A[num]-i-num)
sum_A.sort()
print(sum_A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
B.sort()
A_max=B[N]+N
sum_A=[0]*(A_max+1)
for i in range(A_max+1):
  for num in range(N):
    sum_A[i]+=abs(A[num]-i)
sum_A.sort()
print(sum_A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
B.sort()
A_max=B[N-1]+N
sum_A=[0]*(A_max+1)
for i in range(A_max+1):
  for num in range(N):
    sum_A[i]+=abs(A[num]-i)
sum_A.sort()
print(sum_A[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
B.sort()
A_max=B[N-1]+N
sum_A=[0]*N
for i in range(A_max+1):
  for num in range(N):
    sum_A[i]+=abs(A[num]-i)
sum_A.sort()
print(sum_A[0])
Problem p03325 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
counter=[]
for num in range(len(A)):
  counter.append(0)
for num in range(len(A)):
  while A[num]%2==0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(int, input().split())
counter=[]
for num in range(len(A)):
  counter.append(0)
for num in range(len(A)):
  while A[num]%2==0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(int, input().split())
counter=[]
for num in range(N):
  counter.append(0)
for num in range(N):
  while A[num]%2==0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(int, input().split())
counter=[]
for num in range(N):
  counter.append(0)
for num in range(N):
  while A[num]%2=0:
    A[num]=A[num]/2
    counter[num]+=1
print(sum(counter))
Problem p03434 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
sum1=0
sum2=0
for num in range(N):
  if num % 2 == 0:
    sum1 += A[num]
  else:
    sum2 += A[num]
print(sum1 - sum2)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
A.sort(reverse=True)
sum1=0
sum2=0
for num in range(N+1):
  if num % 2 ==0:
    sum1 += A[num]
  else:
    sum2 += A[num]
print(sum1-sum2)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split))
A.sort()
print(A[N-1]-A[0])
Problem p03470 (python)

Fixed submission:
N=int(input())
z=[]
for num in range(101):
  z.append(0)
counter=0
while counter < N:
  d=int(input())
  z[d]=1
  counter+=1
result=sum(z)
print(result)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N-2):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
  
print(counter)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N-1):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
  
print(counter)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
  
print(counter)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
  else:
    continue
print(counter)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=A.copy()
counter=0
for num in range(N):
  if A[num] in B:
    counter+=1
    while A[num] in B:
      B.remove(A[num])
print(counter)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
count=0
count_sub=0
while len(A) !=0:
  count+=1
  while count_sub < A.count(A[0]):
    A=A.remove(A[0])
    count_sub+=1
print(count)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
count=0
while len(A) !=0:
  count+=1
  while count_sub < A.count(A[0]):
    A=A.remove(A[0])
    count_sub+=1
print(count)
Problem p03471 (python)

Fixed submission:
A=10000
B=5000
C=1000
ans_A=-1
ans_B=-1
ans_C=-1
x,y=map(int,input().split())
for a in range(x+1):
  for b in range(x-a+1):
    c=x-a-b
    if a*A+b*B+c*C==y:
      ans_A=a
      ans_B=b
      ans_C=c
print(ans_A,ans_B,ans_C)

Buggy submission (verdict: Runtime Error):
A=10000
B=5000
C=1000
ans_A=-1
ans_B=-1
ans_C=-1
x,y=map(int,input().split())
for a in range(x+1):
  for b in range(x-a+1):
    for c in range(x-a-b+1):
      if a*A+b*B+c*C=y:
        ans_A=a
        ans_B=b
        ans_C=c
print(ans_A,ans_B,ans_C)

Buggy submission (verdict: Runtime Error):
A=10000
B=5000
C=1000
x,y=map(int,input().split())
for a in range(x+1):
  for b in range(x-a+1):
    for c in range(x-a-b+1):
      if a*A+b*B+c*C=y:
        ans_A=a
        ans_B=b
        ans_C=c
        break
print(ans_A,ans_B,ans_C)

Buggy submission (verdict: Runtime Error):
A=10000
B=5000
C=1000
x,y=map(int,input().split())
for a in range(x):
  for b in range(x-a):
    for c in range(x-a-b):
      if a*A+b*B+c*C=y:
        ans_A=a
        ans_B=b
        ans_C=c
        break
print(ans_A,ans_B,ans_C)
Problem p03000 (python)

Fixed submission:
n, x = map(int, input().split())
l = input().split()
for i in range(n):
    l[i] = int(l[i])

cnt = 1
sum = 0
for i in range(n):
    sum += l[i]
    if sum > x:
        break
    cnt += 1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = input().split()
for i in range(n):
    l[i] = int(l[i])

j = 0
sum = 0
while x >= sum:
    sum += l[j]
    j += 1
    
print(j)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = input().split()
for i in range(n):
    l[i] = int(l[i])

i = 0
sum = 0
while x >= sum:
    sum += l[i]
    i += 1
    
print(i)
Problem p03110 (python)

Fixed submission:
n = int(input())
x = []
u = []
sum = 0.0
for i in range(n):
    tmp1, tmp2 = input().split()
    x.append(float(tmp1))
    u.append(tmp2)
    if u[i] == "JPY":
        sum += x[i]
    else:
        sum += x[i] * 380000

print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = []
u = []
sum = 0.0
for i in range(n):
    tmp1, tmp2 = input().split()
    x.append(int(tmp1))
    u.append(tmp2)
    if u[i] == "JPY":
        sum += x[i]
    else:
        sum += int(x[i] * 380000)

print(sum)
Problem p03146 (python)

Fixed submission:
s = int(input())

def func(n):
    if n % 2 == 0:
        return n / 2
    else:
        return 3 * n + 1

a = {}
a[1] = s

i = 2
while True:
    tmp = func(a[i-1])
    if tmp in a.values():
        print(i)
        break
    else:
        a[i] = tmp
        i += 1

Buggy submission (verdict: Runtime Error):
import copy

n = int(input())
h = []
for i in range(n):
    h.append(int(input()))

h = h.sort()

cnt = 1
now = copy.deepcopy(h[0])
h.pop(0)

while not len(h) == 0:
    if h[0] != now:
        cnt += 1
        now = copy.deepcopy(h[0])
    h.pop(0)
Problem p03030 (python)

Fixed submission:
n=int(input())
sp=[]
for i in range(n):
    s,p=map(str,input().split())
    sp.append([s,int(p),i+1])
sp.sort(key=lambda x: x[1],reverse=True)
sp.sort(key=lambda x: x[0])

for e in sp:
    print(e[2])

Buggy submission (verdict: Runtime Error):
n=int(input())
sp=[]
for i in range(n):
    s,p=map(str(input().split()))
    sp.append([s,int(p),i+1])
sp.sort(key=lambda x: x[1],reverse=True)
sp.sort(key=lambda x: x[0])

for e in sp:
    print(e[2])