include<stdio.h>#include<math.h>int main(){int a[3], b[3], n,sum[3], sum1,sum2,i;scanf("%d\n", &n);for (i = 0; i < 3; i++) {scanf("%d%d", &a[i], &b[i]);if (n%a[i] == 0)sum[i] = (n / a[i])*b[i];else sum[i] = ((n - n % ...