#include using namespace std; // https://img-blog.csdnimg.cn/2019071311082673.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQxNjYxOTE5,size_16,color_FFFFFF,t_70 int main() { int n; scanf("%d", &n); int a, b, c, d, e, f, g, h, i; scanf("%d %d %d %d %d %d", &a, &b, &d, &e, &g, &h); //第一组 c = ((n - 1) / a + 1) * b; //第二组 f = ((n - 1) / d + 1) * e; //第三组 i = ((n - 1) / g + 1) * h; //取最小值时的办法 printf("%d\n", min({c, f, i})); return 0; }