Submission #4659535


Source Code Expand

N,Y = map(int, input().split(" "))
f = False
t = int(Y/10000)
for a in range(t+1):
    for b in range(N+1):
        if a+b>N:
            break
        c=N-a-b
        num = a*10000+b*5000+c*1000
        if num==Y:
            print(str(a)+" "+ str(b)+" "+str(c))
            f=True
            break
    if f:
        break
if f==False:
    print('-1 -1 -1')

Submission Info

Submission Time
Task C - Otoshidama
User osushi5
Language Python (3.4.3)
Score 300
Code Size 377 Byte
Status AC
Exec Time 1102 ms
Memory 3060 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
Set Name Test Cases
Sample a01, a02, a03, a04
All 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 AC 17 ms 3060 KB
a02 AC 17 ms 3060 KB
a03 AC 18 ms 2940 KB
a04 AC 1102 ms 2940 KB
b05 AC 17 ms 2940 KB
b06 AC 17 ms 3060 KB
b07 AC 17 ms 3060 KB
b08 AC 17 ms 2940 KB
b09 AC 1002 ms 2940 KB
b10 AC 200 ms 3060 KB
b11 AC 989 ms 2940 KB
b12 AC 17 ms 3060 KB
b13 AC 19 ms 3060 KB
b14 AC 20 ms 2940 KB
b15 AC 937 ms 3060 KB
b16 AC 997 ms 2940 KB
b17 AC 1076 ms 3060 KB
b18 AC 17 ms 2940 KB
b19 AC 23 ms 2940 KB
b20 AC 18 ms 2940 KB
b21 AC 217 ms 2940 KB
b22 AC 192 ms 2940 KB
b23 AC 940 ms 2940 KB
b24 AC 1001 ms 3060 KB