Company: Google_25oct
Difficulty: medium
Matrix queries Problem Description You are given a N x M binary matrix, that is, the value of each cell in the matrix is either 0 or 1. You must perform Q queries on the matrix. Each query is of the form (x 1 , y 1 , x 2 , y 2 ) where (x 1 ≤ x 2 and y 1 ≤ y 2 ). Choose all the cells (x, y) such that x 1 ≤ x ≤ x 2 and y 1 ≤ y ≤ y 2 and invert its value, that is, if the value is 1 change it to 0 or vice versa. Formally, invert the values of all the cells present in the submatrix enclosed by endpoints (x 1 , y 1 ) and (x 2 , y 2 ). Find the number of cells whose value does not change after applying provided Q queries on the matrix. Input Format The first line contains an integer T denoting the number of test cases. The first line of each test case contains an integer N. The second line of each test case contains an integer M. Next N lines of each test case contain M space-separated integers denoting the binary matrix. The next line of each test case contains an integer Q