Skip to content

Commit cd039fd

Browse files
committed
[BOJ] 설탕 배달 / S4
1 parent 18a6b9b commit cd039fd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

chaeryeon823/BOJ_2839.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 설탕배달
2+
# S4
3+
4+
import sys
5+
6+
n = int(sys.stdin.readline())
7+
result = 0;
8+
while(True):
9+
if(n % 5 == 0):
10+
result += n/5;
11+
print(int(result));
12+
break;
13+
else:
14+
n-=3;
15+
result+=1;
16+
if(n < 0):
17+
print("-1")
18+
break;
19+

0 commit comments

Comments
 (0)