Submission #2202564


Source Code Expand

Copy
N,Y=map(int,input().split())
a,b,c=-1,-1,-1
if Y-1000*N < 0:
  print('-1 -1 -1')
else:
  odd = 0
  Y = Y//1000
  if (Y-N)%2 > 0:
    odd = 1
  for i in range(1+(Y-N)//2):
    a = i
    if (Y-N-9*a)%4 ==0:
      b = (Y-N-9*a)//4
      if 0 <= b and 0 <= N-(b+a):
        c = N-(b+a)
        break
  if c < 0:
    print('-1 -1 -1')
  else:
    print(a,b,c)

Submission Info

Submission Time
Task ABC085C - Otoshidama
User Yellowstone
Language Python3 (3.4.3)
Score 300
Code Size 373 Byte
Status
Exec Time 20 ms
Memory 3064 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03, a04
All 300 / 300 a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 17 ms 3064 KB
a02 17 ms 3064 KB
a03 17 ms 3064 KB
a04 18 ms 3064 KB
b05 18 ms 3064 KB
b06 18 ms 3064 KB
b07 17 ms 3064 KB
b08 17 ms 3060 KB
b09 18 ms 3064 KB
b10 17 ms 3064 KB
b11 20 ms 3064 KB
b12 17 ms 3064 KB
b13 17 ms 3060 KB
b14 17 ms 3060 KB
b15 18 ms 3064 KB
b16 18 ms 3064 KB
b17 18 ms 3064 KB
b18 17 ms 3064 KB
b19 17 ms 3064 KB
b20 17 ms 3060 KB
b21 17 ms 3064 KB
b22 17 ms 3064 KB
b23 20 ms 3060 KB
b24 20 ms 3064 KB