Language: C

#define R(x)if(r>x)r=x;
main(r,D,t,a,b,c,d,e,A,B,C){for(;scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&A,&B,&C)>7;printf("%d\n",r)){
	if(C>=d)r=a*A+b*B+e*C;
	}else{
		r=a*A+b*B+c*C;
		D=d,d-=nc,t=A<d?A:d,A-=t,d-=t,t=B<d?B:d,B-=t,d-=t;
		R(a*A+b*B+e*D)
	}
}exit(0);}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(r,D,t,a,b,c,d,e,A,B,C){for(;scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&A,&B,&C)>7;printf("%d\n",r)){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'r' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'D' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 't' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'e' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'A' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'B' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'C' defaults to 'int' [-Wimplicit-int]
main.c:2:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | main(r,D,t,a,b,c,d,e,A,B,C){for(;scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&A,&B,&C)>7;printf("%d\n",r)){
      |                                  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define R(x)if(r>x)r=x;
main.c:2:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | main(r,D,t,a,b,c,d,e,A,B,C){for(;scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&A,&B,&C)>7;printf("%d\n",r)){
      |                                  ^~~~~
main.c:2:34: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:86: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | main(r,D,t,a,b,c,d,e,A,B,C){for(;scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&A,&B,&C)>7;printf("%d\n",r)){
      |                                                                                      ^~~~~~
main.c:2:86: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:86: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:86: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:10: error: 'else' without a previous 'if'
    4 |         }else{
      |          ^~~~
main.c:6:24: error: 'nc' undeclared (first use in this function); did you mean 'c'?
    6 |                 D=d,d-=nc,t=A<d?A:d,A-=t,d-=t,t=B<d?B:d,B-=t,d-=t;
      |                        ^~
      |                        c
main.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:9:7: error: expected declaration specifiers or '...' before numeric constant
    9 | }exit(0);}
      |       ^
main.c:9:10: error: expected identifier or '(' before '}' token
    9 | }exit(0);}
      |          ^