对于第一种方案,枚举补给凭证购买次数 i (0≤i≤⌈30m⌉),计算购买补给凭证可以获得的晶核数量 300+min(i×30,m)×90,将一二种方案的花费累加并对答案取最小值即可。
#include <bits/stdc++.h>
using namespace std;
/*====================*/
#define ios_close ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define yes puts("Yes")
#define no puts("No")