| 4 | int arr[n][n]; |
| 5 | long long pr[n][n]; |
| 6 | int main(){ |
| 7 | int arr[n][n]; |
| 8 | |
| 9 | int n; |
| 10 | cin>>n; |
| 11 | for (int i = 1; i <= n; ++i) |
| 12 | { |
| 13 | for (int j = 1; j <=n; ++j) |
| 14 | { |
| 15 | cin>>arr[i][j]; |
| 16 | pr[i][j]=arr[i][j]+pr[i-1][j]+pr[i][j-1]-pr[i-1][j-1]; |
| 17 | } |
| 18 | } |
| 19 | int t; |
| 20 | cin>>t; |
| 21 | while(t--){ |
| 22 | int a,b,c,d; |
| 23 | cin>>a>>b>>c>>d; |
| 24 | |
| 25 | cout<<pr[c][d]-pr[a-1][d]-pr[c][b-1]+pr[a-1][b-1]<<endl; |
| 26 | |
| 27 | } |
| 28 | |
| 29 | |
| 30 | return 0; |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected