Read Time:45 Second

'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', function(inputStdin) {
inputString += inputStdin;
});
process.stdin.on('end', function() {
inputString = inputString.split('\n');
main();
});
function readLine() {
return inputString[currentLine++];
}
/*
* Complete the 'gradingStudents' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts INTEGER_ARRAY grades as parameter.
*/
function gradingStudents(grades) {
grades.forEach(calculate);
return grades;
}
function calculate(item, index, arr){
if(item>=38){
let hold=item%5
if(5-hold<3){
item=item+(5-hold)
}
}
arr[index] = item;
}
function main() {
const ws = fs.createWriteStream(process.env.OUTPUT_PATH);
const gradesCount = parseInt(readLine().trim(), 10);
let grades = [];
for (let i = 0; i < gradesCount; i++) {
const gradesItem = parseInt(readLine().trim(), 10);
grades.push(gradesItem);
}
const result = gradingStudents(grades);
ws.write(result.join('\n') + '\n');
ws.end();
}

Content for your website http://fertus.shop/info/
Web Development Wizards http://fertus.shop/info/
Can provide a link mass to your website http://fertus.shop/info/
Web Development Wizards http://fertus.shop/info/
Free analysis of your website http://fertus.shop/info/
I offer mutually beneficial cooperation http://fertus.shop/info/