You don't say of what type you want the matrices to be or whether n, k, n are constant known values at the time of compile or run-time parameters - which makes a big difference.

The simplest way...