Driver Code
public static void Main ( String [ ] args ) { int N = 3 , M = 3 , K = 4 ; int [ , ] query = { { 0 , 0 } , { 1 , 1 } , { 1 , 0 } , { 1 , 2 } } ; int [ ] result = solve ( N , M , query ) ; for ( int i = 0 ; i < K ; i ++ ) Console . Write ( result [ i ] + " ▁ " ) ; } }