백준 30802번: 웰컴 키트 #Python

ColorlessDia·2025년 3월 3일

algorithm/baekjoon

목록 보기
470/809
N = int(input())
size_sequence = map(int, input().split())
T, P = map(int, input().split())

t_bundle = 0
p_bundle = N // P
p_each = 0 if N % P == 0 else N % P

for size in size_sequence:
    t_bundle += size // T

    if size % T != 0:
        t_bundle += 1

print(t_bundle)
print(p_bundle, p_each)

0개의 댓글