In how many ways $k$ identical objects can be distributed in $n$ different boxes so that for each $1 \leq i \leq n$ we have
$$ 2 x_i \leq k+1, $$ for all $1\leq i \leq n$. Roughly speaking, we don't want a box to contain more than half of the objects.
You want to count the nonnegative integer solutions to $\sum_{i=1}^n x_i = k$ subject to $2x_i \le k+1$. Apply the principle of inclusion-exclusion, where the $n$ properties to be avoided are $2x_i \ge k+2$, equivalently, $x_i \ge \lceil k/2 \rceil+1$. If you ignore the properties, stars-and-bars yields $\binom{k+n-1}{n-1}$ solutions. Considering properties one at a time yields an overcount of $\binom{k-(\lceil k/2 \rceil+1)+n-1}{n-1}$. It is not possible to satisfy two or more properties at once. Putting it all together, we have $$\binom{n}{0}\binom{k+n-1}{n-1}-\binom{n}{1}\binom{k-\lceil k/2 \rceil+n-2}{n-1}=\binom{k+n-1}{n-1}-n\binom{\lfloor k/2 \rfloor+n-2}{n-1}$$ solutions.