Misha square n times n matrix number row column j equal a_i j Misha want modify matrix contain exactly k distinct integer to achieve goal Misha perform follow operation zero time choose square submatrix matrix choose x_1y_1 x_2y_2 x_1 leq x_2 y_1 leq y_2 x_2 x_1 y_2 y_1 submatrix set cell coordinate x y x_1 leq x leq x_2 y_1 leq y leq y_2 choose integer k 1 leq k leq n2 replace integer submatrix k please find minimum number operation Misha need achieve goal