Driver code
public static void Main ( ) { int [ , ] matrix = { { 2 , 4 , 6 } , { 8 , 10 , 12 } , { 14 , 16 , 18 } , { 20 , 22 , 24 } } ; int n = matrix . GetLength ( 0 ) ; int m = matrix . GetLength ( 1 ) ; int k = 2 ; Console . WriteLine ( minOperations ( n , m , k , matrix ) ) ; } }