Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m,n,k,i1,j1,i2,j2,i,j,max=0,s;
- int cirese[101][101];
- cin>>n>>m>>k;
- for (i=1; i<=n; i++)
- {
- for (j=1; j<=m; j++)
- {
- cin>>cirese[i][j];
- }
- }
- while(k>0)
- {
- cin>>i1>>j1>>i2>>j2;
- s=0;
- for (i=i1; i<=i2; i++)
- {
- for(j=j1; j<=j2; j++)
- {
- s+=cirese[i][j];
- }
- }
- if(s>max)
- {
- max=s;
- }
- k--;
- }
- cout<<max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement