let finalGrade = [];
for (let i = 0; i < grades.length; i++) {
if (grades[i] <38 || grades[i] % 5 <=2 ) {
finalGrade[i] = grades[i];
}
else {
for(let j=0; j<2;j++) {
grades[i] += 1
if (grades[i] % 5 === 0 ){
finalGrade[i] = grades[i];
break
}
}
}
}
return finalGrade;