Skip to content

Commit 5aaeeca

Browse files
author
Eric
committed
103차 1번 문제풀이
1 parent 602b0b8 commit 5aaeeca

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const fs = require('fs');
2+
const input = fs
3+
.readFileSync(process.platform === 'linux' ? '/dev/stdin' : './input.txt')
4+
.toString()
5+
.trim();
6+
7+
function solution(input) {
8+
let N = input;
9+
let count = 0;
10+
11+
while (N >= 0) {
12+
if (N % 5 === 0) {
13+
count += N / 5;
14+
return count;
15+
}
16+
N -= 3;
17+
count++;
18+
}
19+
20+
return -1;
21+
}
22+
23+
console.log(solution(input));

0 commit comments

Comments
 (0)