Submission #2202679


Source Code Expand

Copy
n,y=map(int,input().split())
for a in range(n+1):
  for b in range(n+1):
    c=n-a-b
    if c<0:
        break
    if a*10000+b*5000+c*1000==y:
      print(a,b,c)
      exit()
      
print("-1 -1 -1")

Submission Info

Submission Time
Task ABC085C - Otoshidama
User TYuto
Language Python3 (3.4.3)
Score 300
Code Size 212 Byte
Status
Exec Time 828 ms
Memory 2940 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 2940 KB
a02 17 ms 2940 KB
a03 18 ms 2940 KB
a04 735 ms 2940 KB
b05 17 ms 2940 KB
b06 17 ms 2940 KB
b07 17 ms 2940 KB
b08 17 ms 2940 KB
b09 721 ms 2940 KB
b10 805 ms 2940 KB
b11 828 ms 2940 KB
b12 17 ms 2940 KB
b13 18 ms 2940 KB
b14 20 ms 2940 KB
b15 751 ms 2940 KB
b16 697 ms 2940 KB
b17 745 ms 2940 KB
b18 18 ms 2940 KB
b19 22 ms 2940 KB
b20 18 ms 2940 KB
b21 822 ms 2940 KB
b22 705 ms 2940 KB
b23 745 ms 2940 KB
b24 767 ms 2940 KB