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)){
	r=a*A+b*B+c*C;
	r=
		C>=d?a*A+b*B+e*C:
		D=d,d-=C,t=B<d?B:d,B-=t,d-=t,t=A<d?A:d,A-=t,d-=t,r>(t=a*A+b*B+e*D)?t:r;
}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:6:18: error: lvalue required as left operand of assignment
    6 |                 D=d,d-=C,t=B<d?B:d,B-=t,d-=t,t=A<d?A:d,A-=t,d-=t,r>(t=a*A+b*B+e*D)?t:r;
      |                  ^
main.c:7:2: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    7 | }exit(0);}
      |  ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | #define R(x)if(r>x)r=x;
main.c:7:2: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    7 | }exit(0);}
      |  ^~~~
main.c:7:2: note: include '<stdlib.h>' or provide a declaration of 'exit'