foo.cc: In function 'int main()':
foo.cc:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   19 |     scanf("%d%d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~
foo.cc:20:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   20 |     for(int i=1;i<=n;i++) scanf("%d",&w[i]);
      |                           ~~~~~^~~~~~~~~~~~
foo.cc:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   27 |         scanf("%d%d%d",&ai,&bi,&wi);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
foo.cc:31:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   31 |     scanf("%d",&q);
      |     ~~~~~^~~~~~~~~
foo.cc:34:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   34 |         scanf("%d%d",&ui,&vi);
      |         ~~~~~^~~~~~~~~~~~~~~~
   
  
    [Hydro](https://hydro.ac)提供评测服务