Monte Carlo calculation of the average solid angle subtended by a parallelepiped detector from a distributed source