If (N > 2K), then the answer is "NO
", because we lack the capacity to hold all the parts.
If there are (3) parts of the same style, then the answer is "NO
". By the pigeonhole principle, any assignment of parts to cases will yield a case with two or more parts of the same style.
Otherwise the answer is "YES
" using the following strategy: First, for any style we have two parts of, put one in each case. Next, evenly distribute the remaining parts (each being a unique style in the store) between the two cases. Informally, this distributes the parts as close to evenly as possible, so we will have enough room in each case.
Formally, one case will have (\lfloor N/2 \rfloor ) parts and the other will have (\lceil N/2 \rceil ) parts. Since (N \le 2K), we have (N/2 \le K), and thus ( \lceil N/2 \rceil \le \lceil K \rceil = K) (inequality preserved since (\lceil x \rceil) is a nondecreasing function). Having shown (\lfloor N/2 \rfloor \le \lceil N/2 \rceil \le K), we see that neither case will exceed capacity.