-Code
cake = [8, 8, 4, 1, 9]
topping = [1, 30, 25, 10]
for _ in range(int(input())):
empty = input()
make_cake = list(map(int, input().split()))
now_topping = list(map(int, input().split()))
min_cnt = 1000000
for i in range(5):
n = round(make_cake[i] / cake[i], 3)
if min_cnt > n:
min_cnt = n
total_cake = int(min_cnt * 16)
total_topping = 0
for i in range(4):
total_topping += now_topping[i] // topping[i]
print(min(total_topping, total_cake))
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 2704번 이진법 시계 (0) | 2022.05.28 |
---|---|
[백준/파이썬] 2596번 비밀편지 (0) | 2022.05.28 |
[백준/파이썬] 2484번 주사위 네개 (0) | 2022.05.28 |
[백준/파이썬] 2408번 큰 수 계산 (0) | 2022.05.28 |
[백준/파이썬] 2399번 거리의 합 (0) | 2022.05.28 |