We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 602b0b8 commit 5aaeecaCopy full SHA for 5aaeeca
1 file changed
live10/test103/문제1/황장현.js
@@ -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