Language: C

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

Compiler output:
main.c:5:1: warning: data definition has no type or storage class
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      | ^
main.c:5:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:5:3: error: type defaults to 'int' in declaration of 'w' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |   ^
main.c:5:5: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |     ^
main.c:5:7: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |       ^
main.c:5:9: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |         ^
main.c:5:14: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |              ^
main.c:5:19: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                   ^
main.c:5:24: error: return type defaults to 'int' [-Wimplicit-int]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                        ^~~~
main.c: In function 'main':
main.c:3:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 | #define s(a) scanf("%d",a);
      |              ^~~~~
main.c:5:31: note: in expansion of macro 's'
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                               ^
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define k 1024
main.c:3:14: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 | #define s(a) scanf("%d",a);
      |              ^~~~~
main.c:5:31: note: in expansion of macro 's'
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                               ^
main.c:3:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
    3 | #define s(a) scanf("%d",a);
      |              ^~~~~
main.c:5:31: note: in expansion of macro 's'
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                               ^
main.c:4:22: error: lvalue required as left operand of assignment
    4 | #define m(a,b) a<b?:a=b
      |                      ^
main.c:5:86: note: in expansion of macro 'm'
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                                                                                      ^
main.c:5:117: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                                                                                                                     ^~~~~~
main.c:5:117: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:117: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:117: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:137: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                                                                                                                                         ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | #define k 1024
main.c:5:137: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    5 | i,w,n,m,c[k],d[k],p[k];main(){s(&n)s(&m)r(n)s(d+i)r(m)s(c+i)r(n)p[i]=1e9;r(m*n)w=i%n,m(p[w],p[w+1]+c[i/n]*d[n-w-1]);printf("%d\n",p[0]),exit(0);}
      |                                                                                                                                         ^~~~
main.c:5:137: note: include '<stdlib.h>' or provide a declaration of 'exit'