tier 웰컴 키트

풀이

티셔츠는 부족해서는 안 되므로 로 나눈 뒤 올림하여 필요한 묶음의 개수를 구합니다. 펜은 따로 살 수 있으므로 로 나눈 뒤 내림하여 필요한 묶음의 개수를 구합니다. 나머지는 잘 계산하면 됩니다.

코드

from math import ceil
 
def main():
    N = int(input())
    sizes = list(map(int, input().split()))
    T, P = map(int, input().split())
 
    shirts_bundle = 0
    for size in sizes:
        shirts_bundle += ceil(size / T)
 
    pen_bundle = N // P
    print(shirts_bundle)
    print(pen_bundle, N - pen_bundle * P)
 
 
main()