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=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:
a.cc:5:1: error: 'i' does not name a type
    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);}
      | ^
a.cc:5:24: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    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);}
      |                        ^~~~
a.cc: In function 'int main()':
a.cc:5:34: error: 'n' was not declared in this scope
    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);}
      |                                  ^
a.cc:3:25: note: in definition of macro 's'
    3 | #define s(a) scanf("%d",a);
      |                         ^
a.cc:3:14: error: 'scanf' was not declared in this scope
    3 | #define s(a) scanf("%d",a);
      |              ^~~~~
a.cc: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);}
      |                               ^
a.cc:5:39: error: 'm' was not declared in this scope
    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);}
      |                                       ^
a.cc:3:25: note: in definition of macro 's'
    3 | #define s(a) scanf("%d",a);
      |                         ^
a.cc:2:18: error: 'i' was not declared in this scope
    2 | #define r(a) for(i=0;i<a;i++)
      |                  ^
a.cc:5:41: note: in expansion of macro 'r'
    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);}
      |                                         ^
a.cc:5:47: error: 'd' was not declared in this scope
    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);}
      |                                               ^
a.cc:3:25: note: in definition of macro 's'
    3 | #define s(a) scanf("%d",a);
      |                         ^
a.cc:2:18: error: 'i' was not declared in this scope
    2 | #define r(a) for(i=0;i<a;i++)
      |                  ^
a.cc:5:51: note: in expansion of macro 'r'
    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);}
      |                                                   ^
a.cc:5:57: error: 'c' was not declared in this scope
    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);}
      |                                                         ^
a.cc:3:25: note: in definition of macro 's'
    3 | #define s(a) scanf("%d",a);
      |                         ^
a.cc:2:18: error: 'i' was not declared in this scope
    2 | #define r(a) for(i=0;i<a;i++)
      |                  ^
a.cc:5:61: note: in expansion of macro 'r'
    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);}
      |                                                             ^
a.cc:5:65: error: 'p' was not declared in this scope
    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);}
      |                                                                 ^
a.cc:2:18: error: 'i' was not declared in this scope
    2 | #define r(a) for(i=0;i<a;i++)
      |                  ^
a.cc:5:74: note: in expansion of macro 'r'
    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);}
      |                                                                          ^
a.cc:5:80: error: 'w' was not declared in this scope
    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);}
      |                                                                                ^
a.cc:5:88: error: 'p' was not declared in this scope
    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);}
      |                                                                                        ^
a.cc:4:16: note: in definition of macro 'm'
    4 | #define m(a,b) a=a<b?a:b
      |                ^
a.cc:5:100: error: 'c' was not declared in this scope
    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);}
      |                                                                                                    ^
a.cc:4:20: note: in definition of macro 'm'
    4 | #define m(a,b) a=a<b?a:b
      |                    ^
a.cc:5:107: error: 'd' was not declared in this scope
    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);}
      |                                                                                                           ^
a.cc:4:20: note: in definition of macro 'm'
    4 | #define m(a,b) a=a<b?a:b
      |                    ^
a.cc:5:131: error: 'p' was not declared in this scope
    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);}
      |                                                                                                                                   ^
a.cc:5:117: error: 'printf' was not declared in this scope
    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);}
      |                                                                                                                     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define k 1024
a.cc:5:137: error: 'exit' was not declared in this scope
    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);}
      |                                                                                                                                         ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | #define k 1024