Function to update and print the matrix after performing queries
static void updateMatrix ( int n , int q [ ] [ ] , int mat [ ] [ ] ) { int i , j ; for ( i = 0 ; i < q . length ; i ++ ) { int X1 = q [ i ] [ 0 ] ; int Y1 = q [ i ] [ 1 ] ; int X2 = q [ i ] [ 2 ] ; int Y2 = q [ i ] [ 3 ] ;