https://www.codechef.com/COW42020/problems/COW3E/
Please can you help me in understanding the problem.Iam having some probelm on how the output is coming.
https://www.codechef.com/COW42020/problems/COW3E/
Please can you help me in understanding the problem.Iam having some probelm on how the output is coming.
In the sample input, the given matrix is -
1 2 3
1 1 0
4 -2 2
2 modifications are there.
First is 2 0 0 1 1 which means we add 2 to each element of the rectangle whose diagonal corners are: (0,0) and (1,1). Resulting matrix -
3 4 3
3 3 0
4 -2 2
Second is -1 1 0 2 2 which means we add -1 to each element of the rectangle whose diagonal corners are: (1,0) and (2,2). Resulting matrix -
3 4 3
2 2 -1
3 -3 1
Now we have two queries.
First is 0 0 0 1 which means we have to display the sum of elements in the rectangle represented by the corners: (0,0) and (0,1).
Answer = 3 + 4 = 7
Second is 1 1 2 2 which means we have to display the sum of elements in the rectangle represented by the corners: (1,1) and (2,2).
Answer = 2 + (-1) + (-3) + 1 = -1
So the output is -
7
-1
Thank un.understood very well
Welcome. Please mark this doubt as resolved now.
can u share "Please rate your experience " link
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.