Implement a function that calculates the number of non-empty multisets containing between 0 and K instances of each integer from 1 to N, such that the average of the elements equals x for each x from 1 to N. The results should be returned modulo M.
N (int): The maximum integer value in the multisets, where ( 1 \leq N \leq 1000 ).
K (int): The maximum number of instances of each integer in the multisets, where ( 0 \leq K \leq 100 ).
M (int): The modulus for the result, where ( 1 \leq M \leq 10^9 ).
Output:
The function should return a list of integers where the i-th element represents the number of multisets such that the average of the elements is ( i + 1 ), computed modulo M.
Implementation Requirements:
The solution must be implemented in a Python file named /app/solution.py.
Ensure to follow best coding practices, including appropriate variable naming and documentation within the code.