You are given three integers m, n, and k.
Consider an m by n grid where k identical pieces are placed such that each cell contains at most
The Manhattan distance between two cells at coordinates
Return the total sum of Manhattan distances between all pairs of pieces across all valid arrangements. Since the answer may be very large, return it modulo
Constraints:
m, n
m $ imes$ n
k m $ imes$ n
You are given three integers m, n, and k.
Consider an m by n grid where k identical pieces are placed such that each cell contains at most
The Manhattan distance between two cells at coordinates
Return the total sum of Manhattan distances between all pairs of pieces across all valid arrangements. Since the answer may be very large, return it modulo
Constraints:
m, n
m $ imes$ n
k m $ imes$ n