Skip to content

Instantly share code, notes, and snippets.

@rubentd
Last active November 4, 2019 16:41
Show Gist options
  • Save rubentd/a9622c852d5f53c0711df0f1c34a27a6 to your computer and use it in GitHub Desktop.
Save rubentd/a9622c852d5f53c0711df0f1c34a27a6 to your computer and use it in GitHub Desktop.
'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*$/, '')
.split('\n')
.map(str => str.replace(/\s*$/, ''));
main();
});
function readLine() {
return inputString[currentLine++];
}
// Complete the saveTheKid function below.
function saveTheKid(n, m, s) {
}
function main() {
const ws = fs.createWriteStream('./sample.out');
const t = parseInt(readLine(), 10);
for (let tItr = 0; tItr < t; tItr++) {
const nms = readLine().split(' ');
const n = parseInt(nms[0], 10);
const m = parseInt(nms[1], 10);
const s = parseInt(nms[2], 10);
let result = saveTheKid(n, m, s);
ws.write(result + "\n");
}
ws.end();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment