There are $20$ coloured balls of various colours in a bag, such that if you pick two balls at random the chance that the two chosen balls match in colour is $50\%$.
What does the arrangement of the twenty coloured balls need to be? For example there might be 'a' of one colour, 'b' of a second colour, 'c' of a third colour etc.
The problem is that of partitioning $20$ as $a_1+\cdots+a_n=20$ so that $\sum_{k=1}^na_k(a_k-1)=190$. Following from @JMorovitz' comment, it suffices to consider only $a_1=13$ and $a_1=14$. All but one of the few possibilities are easily eliminated, leaving $a_1=14$, $a_2=3$, $a_3=2$, and $a_4=1$.