Problem p03471 (python)

Fixed submission:
import sys

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

for a in range(n+1):
	for b in range(n+1-a):
		c = n - a - b
		if (a * 10000 + b * 5000 + c * 1000 == y):
				print(str(a) + ' ' + str(b) + ' ' + str(c))
				sys.exit()
	
print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

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

for a in range(n+1):
  for b in range(n+1-a):
      c = n - a - b
      if a * 10000 + b * 5000 + c * 1000 == y:
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()
	
print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

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

for a in range(n+1):
	for b in range(n+1-a):
      c = n - a - b
      if (a * 10000 + b * 5000 + c * 1000 == y):
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()
	
print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
  for b in range(n+1-a):
    if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
      print(a)
	  sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
  for b in range(n+1-a):
    if a * 10000 + b * 5000 + (n-a-b) * 1000 == y:
      print(a)
	  sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
  for b in range(n+1-a):
    if a * 10000 + b * 5000 + (n-a-b) * 1000 == y:
      print(str(a) + ' ' + str(b) + ' ' + str(c))
	  sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
  for b in range(n+1-a):
    if a * 10000 + b * 5000 + (n-a-b) * 1000 == y:
      print(str(a) + ' ' + str(b) + ' ' + str(c))
#	  sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

n = n+1
y = y+1
for a in range(n+1):
#  for b in range(n+1-a):
    b = 1
    if a * 10000 + b * 5000 + (n-a-b) * 1000 == y:
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
  for b in range(n+1-a):
    if a * 10000 + b * 5000 + (n-a-b) * 1000 == y:
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
#	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
#		print(str(a) + ' ' + str(b) + ' ' + str(c))
#		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
#	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
	  if a * 10000 + b * 5000 + (n-a-b) * 1000 == y:
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1):
	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
		print(str(a) + ' ' + str(b) + ' ' + str(c))
		sys.exit()

print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1-a):
	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
				print(str(a) + ' ' + str(b) + ' ' + str(c))
				sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y = map(int, input().split())

for a in range(n+1):
	for b in range(n+1):
	  if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
				print(str(a) + ' ' + str(b) + ' ' + str(c))
				sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n,y= map(int, input().split())

for a in range(n+1):
	for b in range(n+1):
			if (a * 10000 + b * 5000 + (n-a-b) * 1000 == y):
				print(str(a) + ' ' + str(b) + ' ' + str(c))
				sys.exit()

print('-1 -1 -1')
sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

n, y = input().split()
n = int(n)
y = int(y)

for a in range(n+1):
	for b in range(n+1):
		for c in range(n+1):
            if a + b + c < n:
              continue
            if a + b + c > n:
              break
			if (a + b + c == n) and (a * 10000 + b * 5000 + c * 1000 == y):
				print(str(a) + ' ' + str(b) + ' ' + str(c))
				sys.exit()

print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
import sys

n, y = input().split()
n = int(n)
y = int(y)

for a in range(n+1):
	for b in range(n+1-a):
		for c in range(n+1-a-b):
            if a + b + c < n:
              continue
            if a + b + c > n:
              break
			if (a + b + c == n) and (a * 10000 + b * 5000 + c * 1000 == y):
				print(str(a) + ' ' + str(b) + ' ' + str(c))
				sys.exit()

print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
import sys

n, y = input().split()
n = int(n)
y = int(y)

for a in range(n+1):
	for b in range(n+1-a):
		for c in range(n+1-a-b):
			if a * 10000 + b * 5000 + c * 1000 == y:
				print(a + ' ' + b + ' ' + c)
				sys.exit()

print('-1 -1 -1')