#abc331b. B - Buy One Carton of Milk
B - Buy One Carton of Milk
Score : points
问题描述
一家超市出售鸡蛋包装。
一包包含6个鸡蛋的价格是S日元,一包包含8个鸡蛋的价格是M日元,而一包包含12个鸡蛋的价格是L日元。
在你可以购买任意数量的每种包装的情况下,找出至少购买N个鸡蛋所需的最少金额。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
A supermarket sells egg packs.
A pack of eggs costs yen, a pack of eggs costs yen, and a pack of eggs costs yen.
When you can buy any number of each pack, find the minimum amount of money required to purchase at least eggs.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
16 120 150 200
Sample Output 1
300
It is optimal to buy two -egg packs.
Sample Input 2
10 100 50 10
Sample Output 2
10
It is optimal to buy one -egg pack.
Sample Input 3
99 600 800 1200
Sample Output 3
10000
It is optimal to buy five -egg packs and five -egg packs.
update @ 2024/3/10 01:15:13