[![enter image description here](https://i.stack.imgur.com/5AHIo.png)](https://i.stack.imgur.com/5AHIo.png)
I have some questions about the solution to the five pills problem which is part of the list of exercises based on Feynman's lectures. [![form](https://i.stack.imgur.com/XIAgH.png)](https://i.stack.imgur.com/XIAgH.png)

In the solution above m is the number of types of pills and there are n pills of each type for a total of mn pills. K is the number of pills drawn without replacement.

I understand how the principle of inclusion exclusion was used to find L(m,n,k) but am unsure how in the above solution the expression for O(m,n,k) was arrived at. Also, how can it be valid if in the summation j ranges from 0 to m and j-m-1 is negative for these values of j?