Given a $d$-dimensional hyperrectangle that spans from the origin to the integer coordinates $l_1,l_2,l_3,\cdots,l_d$. If $V$ is the hypervolume of the solid formed by all points in the hyperrectangle such the manhattan distance of the point to the origin is less than a given integer $s$.
Given that $2\le d\le 300$, $1\le l_i\le 300$, $0\le s\le\sum l_i$, is there an efficient algorithm for calculating $V\times d! \pmod{p}$ for a prime $p$?