AT_abc331_b 题解
题目链接:
[ABC331B] Buy One Carton of Milk
题意简述:
现在
解题思路:
由于
参考代码:
#include<bits/stdc++.h>
using namespace std;
long long n,a,b,c,ans=1e18;
#define lowbit(x) x&-x
#define pb push_back
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define endl '\n'
#define QwQ return 0;
int main()
{
IOS;
cin>>n>>a>>b>>c;
for(int i=0;i<=100;i++)
for(int j=0;j<=100;j++)
for(int k=0;k<=100;k++)
if(i*6+j*8+k*12>=n)
ans=min(ans,i*a+j*b+k*c);
cout<<ans;
QwQ;
}