Extract a subpart of array Z with the given shape, centered on the element at position, padding with fill where it falls outside Z. Return the subpart.
Z
shape
position
fill
solve(...)