#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> using namespace std; int main() { int a, b, X, Y, Z,N,max=0,cost; while (scanf("%d\n%d %d %d", &N, &X, &Y, &Z) != EOF) { max = 0; cost = 0; for (a = 1; a <= 9; a++) { for (b = 0; b <= 9; b++) { cos...