Input: N = 2, K = 2
Output: {{1, 3}, {2, 4}}
Explanations: The possible row-wise sorted matrices are [{{1, 2}, {3, 4}}, {{1, 3}, {2, 4}}, {{1, 4}, {2, 3}}, {{3, 4}, {1, 2}}, {{2, 4}, {1, 3}}, {{2, 3}, {1, 4}} ]
Out of all the above possible matrices, the matrices [{{1, 3}, {2, 4}}, {{2, 4}, {1, 3}}, {{1, 4}, {2, 3}}, {{2, 3}, {1, 4}}] contains the maximum possible sum of the Kth column.
Therefore, one of the possible output is {{1, 3}, {2, 4}}.
Input: N = 3, K = 2
Output: {{1, 4, 5}, {2, 6, 7}, {3, 8, 9}}