def _get_zero_one_knapsack_matrix(total_weight: int, n: int) -> list:
    """Returns a matrix for a dynamic programming solution to the 0/1 knapsack
    problem.

    The first row of this matrix contains the numbers corresponding to the
    weights of the (sub)problems. The first column contains an enumeration of
    the items, starting from the fact that we could not include any item, and
    this is represented with a 0.

    m[0][0] is 0 just because of the alignment, it does make any logical sense
    for this purpose, it could be None, or any other value."""
    m = [[0 for _ in range(total_weight + 2)] for _ in range(n + 2)]

    for x in range(1, total_weight + 2):
        m[0][x] = x - 1

    for j in range(1, n + 2):
        m[j][0] = j - 1
        m[j][1] = 0

    return m