Among $20$ yellow and $20$ green points, with $e$ edges, there must a pair of yellow and a pair of green points that are all connected We have $n$ points, let's call them the yellow ones and $k$ other points (let's call them green). Then, we connect these points with a specified ($e$) number of lines. Each line $e$ is just an edge between a single green point and a single yellow point. The position of the points is not important.
I was asked to prove the following theorem: Assume $n=20$, $k=20$, and $99\le e \le 20^2=400$. Then there will always be two yellow points $y_1$, $y_2$ and two green points $g_1$, $g_2$, such that there will be a line between (respectively) $y_1$ and $g_1$, $y_1$ and $g_2$, $y_2$ and $g_1$, $y_2$ and $g_2$. 
Unfortunately, even if I can see this theorem seems to be true (checking by hand), I have no idea about how to prove it rigorously. 
 A: Let's say the $i$th yellow point is connected to $e_i$ green points. So we have $e_1 + e_2 + e_3 + \cdots + e_{20} = e \ge 99$.
It follows just from the above inequality that
$$\sum_{i = 1}^{20} \binom{e_i}{2} \ge 196. \tag{1}$$
(We will come back in a moment to the proof of this.) From here, $\binom{e_i}{2}$ is the number of pairs of green points connected to the $i$th yellow point, and there are only $\binom{20}{2} = 190$ pairs of green points available, so there must be some $i$ and $j$ such that yellow point $i$ and yellow point $j$ are connected to the same pair of green points. (Why is this true?) So we are done. (Why?)

Now let's prove (1). Intuitively, to minimize $\sum_{i=1}^{20} \binom{e_i}{2}$, $e_i$ should be as equal as possible, because $\binom{e_i}{2}$ increases at a faster rate as $e_i$ increases, and the sum of the $e_i$s is fixed, so it increases the total sum less if we increase smaller $e_i$s first.
Formally, $\binom{e_i}{2}$ is quadratic and suggests the QM-AM inequality.
We can write $\binom{e_i}{2} = \frac12 (e_i-1)^2 + \frac12 (e_i-1)$.
Then
\begin{align*}
\sum_{i=1}^{20} \binom{e_i}{2}
&= \frac12 \sum_{i=1}^{20} (e_i - 1)^2 + \frac12 \sum_{i=1}^{20} (e_i - 1) \\
&= 10 \frac{\sum_{i=1}^{20} (e_i - 1)^2}{20} + \frac12 \sum_{i=1}^{20} (e_i - 1) \\
&\ge 10 \left(\frac{\sum_{i=1}^{20} |e_i - 1|}{20}\right)^2 + \frac12 \sum_{i=1}^{20} (e_i - 1) \\
&= \frac{1}{40} \left(\sum_{i=1}^{20} |e_i - 1| \right)^2 + \frac12 \sum_{i=1}^{20} (e_i - 1)
\end{align*}
Now $\sum_{i=1}^{20} e_i \ge 99$, so $\sum_{i=1}^{20} |e_i - 1| \ge \sum_{i=1}^{20} (e_i - 1) \ge 79$. So we get from above
\begin{align*}
&\ge \frac{1}{40} (79^2) + \frac12 (79) \\
&= 195.525 \\
&> 195.
\end{align*}
Taken all together, this proves (1).
