Function to construct a matrix of size A * B from the given matrix elements
def ConstMatrix ( mat , N , M , A , B ) : NEW_LINE INDENT if ( N * M != A * B ) : NEW_LINE INDENT return - 1 NEW_LINE DEDENT idx = 0 ; NEW_LINE DEDENT