Language: C

#define r(a,i)for(i=0;i<a;i++)
#define s (scanf("%d",&w),w)
#define c(a,b)a<b?:a=b
d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}

Compiler output:
main.c:4:1: warning: data definition has no type or storage class
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      | ^
main.c:4:1: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:4:8: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |        ^
main.c:4:15: error: return type defaults to 'int' [-Wimplicit-int]
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |               ^~~~
main.c: In function 'main':
main.c:4:15: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:4:15: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:4:15: error: type of 'w' defaults to 'int' [-Wimplicit-int]
main.c:4:15: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:4:15: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:2:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | #define s (scanf("%d",&w),w)
      |            ^~~~~
main.c:4:33: note: in expansion of macro 's'
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                 ^
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define r(a,i)for(i=0;i<a;i++)
main.c:2:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | #define s (scanf("%d",&w),w)
      |            ^~~~~
main.c:4:33: note: in expansion of macro 's'
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                 ^
main.c:2:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #define s (scanf("%d",&w),w)
      |            ^~~~~
main.c:4:33: note: in expansion of macro 's'
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                 ^
main.c:3:21: error: lvalue required as left operand of assignment
    3 | #define c(a,b)a<b?:a=b
      |                     ^
main.c:4:82: note: in expansion of macro 'c'
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                                                                  ^
main.c:4:109: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                                                                                             ^~~~~~
main.c:4:109: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:109: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:4:109: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:4:127: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                                                                                                               ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | #define r(a,i)for(i=0;i<a;i++)
main.c:4:127: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    4 | d[999],p[999];main(i,j,w,n,m){n=s;m=s;r(n,i)d[i]=s;r(n,i)p[i]=1e9;r(m,j){s;r(n,i)c(p[i],p[i+1]+w*d[n-i-1]);}printf("%d\n",*p),exit(0);}
      |                                                                                                                               ^~~~
main.c:4:127: note: include '<stdlib.h>' or provide a declaration of 'exit'