Language: C++

#import<ios>
#define r(a)for(int i=0;i<a;i++)
#define s (std::cin>>w,w)
#define c(a,b)a=a<b?a:b
int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<ios>
      |  ^~~~~~
a.cc:5:25: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                         ^~~~
a.cc: In function 'int main()':
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:34: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                  ^
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #import<ios>
  +++ |+#include <iostream>
    2 | #define r(a)for(int i=0;i<a;i++)
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:38: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                      ^
a.cc:3:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:38: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                      ^
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:49: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                                 ^
a.cc:3:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:49: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                                 ^
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:69: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                                                     ^
a.cc:3:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:69: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                                                     ^
a.cc:5:107: error: 'cout' is not a member of 'std'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}std::cout<<*p<<"\n";}
      |                                                                                                           ^~~~
a.cc:5:107: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'