Skip to content

Commit 070c341

Browse files
committed
[BOJ] #26099. 설탕 배달2 / 실버4 / 60분 / 성공
1 parent 1698864 commit 070c341

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 26099 : 설탕 배달 2
2+
import sys
3+
input = sys.stdin.readline
4+
5+
N = int(input().strip()) # kg
6+
bag_count = 0 # 봉지 수
7+
8+
while N >= 0:
9+
# 5kg 봉지 최대한 많이 사용해야 한다.
10+
if N % 5 == 0: # 5의 배수인 경우, 5의 몫을 저장
11+
bag_count += N // 5
12+
print(bag_count)
13+
break
14+
N -= 3
15+
bag_count += 1
16+
else:
17+
print(-1)

0 commit comments

Comments
 (0)