5. In a regular $n$-sided pyramid, the range of the dihedral angle formed by two adjacent lateral faces is
A. $\left(\frac{n-2}{n} \pi, \pi\right)$
B. $\left(\frac{n-1}{n} \pi, \pi\right)$
C. $\left(0, \frac{\pi}{2}\right)$
D. $\left(\frac{n-2}{n} \pi, \frac{n-1}{n} \pi\right)$
When the vertex of a regular $n$-sided pyramid is infinitely far from the base, the regular $n$-sided pyramid becomes a regular $n$-sided prism, and the dihedral angle between adjacent sides is $\frac{n-2}{n} \pi$; when the vertex of the regular $n$-sided pyramid is at the center of the base, the regular $n$-sided pyramid becomes a regular $n$-sided polygon, and the dihedral angle between adjacent sides is $\pi$. Therefore, the answer is $A$.