Given a matrix like this:
1 1 3 -2
3 -4 1 -1
1 1 1 0
0 -1 0 0
By taking a 2×2 "sliding sum", where the sum of every 2×2 region of the matrix is one element of the resulting matrix, we get:
1 1 1
1 -1 1
1 1 1
We can do this for sliding windows of any size. For example, a 1×3 sliding sum of the same input matrix would be:
5 2
0 -4
3 2
-1 -1
In this challenge, you'll be given an output matrix and a window size, and should return a matrix whose sliding sum with the given window size is the input. The window size will be at least 1×1, but there is no maximum size.
Inputs and outputs will consist only of integers. Note that there are arbitrarily many correct solutions for most window sizes.
This is code-golf, so shortest answer per language (in bytes) wins.