Finding the values we need to xor with value at ( x2 , y2 ) in prefix - xor matrix
if ( $ x1 != 0 ) $ xor_1 = $ prefix_xor [ $ x1 - 1 ] [ $ y2 ] ; if ( $ y1 != 0 ) $ xor_2 = $ prefix_xor [ $ x2 ] [ $ y1 - 1 ] ; if ( $ x1 != 0 and $ y1 != 0 ) $ xor_3 = $ prefix_xor [ $ x1 - 1 ] [ $ y1 - 1 ] ;