Printing the solution .
def prt ( dist ) : NEW_LINE INDENT c = 1 NEW_LINE for i in range ( 1 , n * m + 1 ) : NEW_LINE INDENT print ( dist [ i ] , end = " ▁ " ) NEW_LINE if ( c % m == 0 ) : NEW_LINE INDENT print ( ) NEW_LINE DEDENT c += 1 NEW_LINE DEDENT DEDENT