Language: C++

#include <cstdio>
#define k 1024
#define r(a) for(int i=0;i<a;i++)
#define s(a) scanf("%d",&a);
#define m(a,b) a<b?a:b
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+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}

Compiler output:
a.cc:6:1: error: 'w' does not name a type
    6 | w,n,m,c[k],d[k],p[k];
      | ^
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |          ^
a.cc:4:26: note: in definition of macro 's'
    4 | #define s(a) scanf("%d",&a);
      |                          ^
a.cc:7:14: error: 'm' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |              ^
a.cc:4:26: note: in definition of macro 's'
    4 | #define s(a) scanf("%d",&a);
      |                          ^
a.cc:7:22: error: 'd' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                      ^
a.cc:4:26: note: in definition of macro 's'
    4 | #define s(a) scanf("%d",&a);
      |                          ^
a.cc:7:33: error: 'c' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                                 ^
a.cc:4:26: note: in definition of macro 's'
    4 | #define s(a) scanf("%d",&a);
      |                          ^
a.cc:7:44: error: 'p' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                                            ^
a.cc:7:53: error: 'p' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                                                     ^
a.cc:7:66: error: 'w' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                                                                  ^
a.cc:7:93: error: 'c' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                                                                                             ^
a.cc:5:18: note: in definition of macro 'm'
    5 | #define m(a,b) a<b?a:b
      |                  ^
a.cc:7:100: error: 'd' was not declared in this scope
    7 | main(){s(n)s(m)r(n)s(d[i])r(m)s(c[i])r(n+1)p[i]=1e9;p[0]=0;r(m*n)w=n-i%n,p[w]=m(p[w],p[w-1]+c[i/n]*d[w-1]);printf("%d\n",p[n]);}
      |                                                                                                    ^
a.cc:5:18: note: in definition of macro 'm'
    5 | #define m(a,b) a<b?a:b
      |                  ^