https://www.acmicpc.net/problem/30802
n : 전체 인원 수
shirts : 각 사이즈 별 인원 수 리스트
t , p : 티셔츠 와 펜의 한 묶음의 갯수
티셔츠의 경우는 남아도 되지만 모자르면 안되므로 묶음 수로 나누었을 때 나머지가 나오면 한 묶음을 더해주어야 한다.
펜의 경우는 몪과 나머지를 각각 출력해주면 된다.
n = int(input())
shirts = list(map(int,input().split()))
t , p = map(int,input().split())
maxt = maxp = pen = 0
for shirt in shirts:
if shirt % t > 0:
temp = (shirt//t) + 1
else:
temp = (shirt//t)
maxt += temp
maxp = n // p
pen = n % p
print(maxt)
print(maxp,pen)
'코딩테스트' 카테고리의 다른 글
[python] 백준 1012번 : 유기농 배추 (실버2) (0) | 2024.07.10 |
---|---|
[python] 백준 1003번 : 피보나치 함수 (실버3) (0) | 2024.07.10 |
[python] 백준 28702번 : FizzBuzz (0) | 2024.07.09 |
[python] 백준 18110번 : solved.ac (0) | 2024.07.09 |
[python] 백준 10989번 : 수 정렬하기 3 (0) | 2024.07.08 |