foo.cc: In function 'int dfs(int, int, int)':
foo.cc:24:6: warning: unused variable 'w' [-Wunused-variable]
  int w=0,t=0,num=len;
      ^
foo.cc:24:10: warning: unused variable 't' [-Wunused-variable]
  int w=0,t=0,num=len;
          ^
foo.cc: In function 'int main()':
foo.cc:47:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(int i=1;i<=n;i++)
  ^~~
foo.cc:55:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    cout<<ans;
    ^~~~
foo.cc:43:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~~~~~
foo.cc:46:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
      scanf("%lld",&a[i][j]);
      ~~~~~^~~~~~~~~~~~~~~~~
   
  
    [Hydro](https://hydro.ac)提供评测服务