The following question comes from the A sine integral post, in which user26872 proved the following: $$\int_{-\infty}^\infty \left(\frac{\sin x}{x}\right)^n dx=\frac{1}{(2i)^n}\sum_{k=0}^n(-1)^k \binom{n}{k}\int_{-\infty}^\infty \frac{e^{(n-2k)ix}}{x^n}dx$$$$=\frac{1}{(2i)^n}\sum_{k=0}^{\lfloor n/2 \rfloor}(-1)^k \binom{n}{k}\int_{-\infty}^\infty \frac{e^{(n-2k)ix}}{x^n}dx$$

This then leads to the use of Cauchy's differentiation formula to get: $$\int_{-\infty}^\infty \left(\frac{\sin x}{x}\right)^n dx=\frac{\pi}{(n-1)!}\sum_{k=0}^{\lfloor n/2\rfloor} (-1)^k \binom{n}{k}\left(\frac{n}{2}-k\right)^{n-1}$$

which gives the exact value of the integral for any positive integer value of n. I was able to prove this with a long and cumbersome derivation using the Laplace transform, but this user used contour integration. However, they did not specify how the contour was defined. I think it is a diameter from -R to R on the real axis then a semicircle in the lower half-plane back to -R, in the limit as $R\rightarrow\infty$, as it is easy to show that the integral over the arc tends to 0, thus making the integral over the contour equal to the integral over the real axis.

I'm fairly new to contour integration and complex analysis, which is why I wasn't able to understand why, using this technique, the upper limit of the sum changes from n to $\lfloor n/2 \rfloor$. The user specified a condition that if $n-2k\geq0$ (which means the max value of k would be $\lfloor n/2 \rfloor$), they would close the contour in the upper half-plane. But why?

Thanks!