Submission #3090490


Source Code Expand

Copy
'use strict'
let lines = [];
let reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', function(line) {
  lines.push(line);
});

reader.on('close', function() {
    let params = lines[0].split(/\s/).map((x) => { return parseInt(x); });
    let N = params[0], Y = params[1];
    Y /= 1000;
    for(let a = 0; 9 * a <= Y - N; a++){
        for(let b = 0; 9 * a + 4 * b <= Y - N; b++){
            if(9 * a + 4 * b !== Y - N)
                continue;
            let c = N - a - b;
            if(c < 0)
                continue;
            console.log(a, b, c);
            return;
        }
    }
    console.log(-1, -1, -1);
});

Submission Info

Submission Time
Task ABC085C - Otoshidama
User my316g
Language JavaScript (node.js v5.12)
Score 300
Code Size 720 Byte
Status
Exec Time 166 ms
Memory 11724 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 64 ms 11724 KB
a02 60 ms 7628 KB
a03 60 ms 7628 KB
a04 166 ms 7628 KB
b05 60 ms 7628 KB
b06 60 ms 7628 KB
b07 60 ms 7628 KB
b08 60 ms 7628 KB
b09 165 ms 7628 KB
b10 60 ms 7628 KB
b11 166 ms 7628 KB
b12 60 ms 7628 KB
b13 60 ms 7628 KB
b14 60 ms 7628 KB
b15 163 ms 7628 KB
b16 157 ms 7628 KB
b17 158 ms 7628 KB
b18 60 ms 7500 KB
b19 61 ms 7628 KB
b20 61 ms 7628 KB
b21 60 ms 7628 KB
b22 61 ms 11596 KB
b23 161 ms 7628 KB
b24 156 ms 7628 KB