Driver code
public static void Main ( String [ ] args ) { int [ , ] arr = { { 1 , 2 , 3 } , { 4 , 5 , 6 } , { 7 , 8 , 9 } } ; findPrefixCount ( arr ) ; int [ , ] queries = { { 1 , 1 , 1 , 1 } , { 1 , 2 , 2 , 2 } } ; int q = queries . GetLength ( 0 ) ; for ( int i = 0 ; i < q ; i ++ ) Console . WriteLine ( rangeAnd ( queries [ i , 0 ] , queries [ i , 1 ] , queries [ i , 2 ] , queries [ i , 3 ] ) ) ; } }