xor of submatrix from i , j to i1 , j1 is ( xor of submatrix from 1 , 1 to i1 , j1 ) ^ ( xor of submatrix from 1 , 1 to i - 1 , j - 1 ) ^ ( xor of submatrix from 1 , 1 to i1 , j - 1 ) ^ ( xor of submatrix from 1 , 1 to i - 1 , j1 )
x = 0 NEW_LINE x ^= prefix_xor [ i1 ] [ j1 ] NEW_LINE x ^= prefix_xor [ i - 1 ] [ j - 1 ] NEW_LINE x ^= prefix_xor [ i1 ] [ j - 1 ] NEW_LINE x ^= prefix_xor [ i - 1 ] [ j1 ] NEW_LINE