模拟 高性能
AC代码:
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
int main() {
int n, i, j, k = 0, arr[3][2], temp[3] = {0}, min;
scanf("%d", &n);
for ( i = 0; i < 3; i++)
scanf("%d %d", &arr[i][0], &arr[i][1]);
for ( i = 0; i < 3; i++){
while(k*arr[i][0] < n){
k++;
temp[i] = k*arr[i][1];
}
k = 0; //记得这里的组数要归零
}
min = temp[0];
for ( i = 1; i < 3; i++){
if (min > temp[i])
min = temp[i];
}
printf("%d", min);
return 0;
}