foo.cc: In function 'int main()':
foo.cc:6:2: error: 'cin' was not declared in this scope
  cin>>n>>R;
  ^~~
foo.cc:6:2: note: suggested alternative: 'main'
  cin>>n>>R;
  ^~~
  main
foo.cc:25:10: error: 'max' was not declared in this scope
    ans = max(ans,S[i][j] - S[i - R][j] - S[i][j - R] + S[i - R][j - R]);
          ^~~
foo.cc:25:10: note: suggested alternative: 'main'
    ans = max(ans,S[i][j] - S[i - R][j] - S[i][j - R] + S[i - R][j - R]);
          ^~~
          main
foo.cc:28:2: error: 'cout' was not declared in this scope
  cout<<ans;
  ^~~~
   
  
    [Hydro](https://hydro.ac)提供评测服务