ktoij: Convert One-Dimensional Index k to Two-Dimensional Indices i and j
Description
ktoij is a helper function that converts a one-dimensional index
k to two-dimensional indices i and j. This can be
useful if, for example, two-dimensional indexing is easier to implement
than one-dimensional indexing.