[백준] 설탕배달 2839 solved by Python N = int(input()) five_kg_bag = 0 three_kg_bag = 0 while N >= 0: if N % 5 == 0: five_kg_bag += N // 5 print(five_kg_bag + three_kg_bag) break else: N -= 3 three_kg_bag += 1 else: print(-1) 알고리즘 2022.10.04