5. Giulio knows that in his drawer there are, all mixed up, 20 black socks, 32 blue socks, 44 gray socks, and 24 brown socks, all of the same shape. He is leaving and wants to bring at least two pairs of socks that match well, of two different colors (the two socks of each pair must be the same color, but the two pairs must be of different colors). Since it is dark and he cannot distinguish the colors, he takes a pile of socks at random. How many socks does he need to put in his suitcase, at a minimum, to be sure of bringing at least two pairs that match well of two different colors?
(A) 77
(B) 6
(C) 68
(D) 48
(E) 24
Problem 5. The answer is (D).

Giulio cannot match two pairs of socks of two different colors only if he has taken, of each color except at most one, at most one sock. The maximum number of socks he can have taken without being able to match two pairs of different colors is obtained by taking all the socks of the most numerous color and exactly one sock of each other color. This means taking all 44 gray socks and then a single sock of the remaining colors black, blue, and brown, for a total of 47 socks. As soon as Giulio has taken at least 48 socks, he is therefore sure to be able to match two pairs of different colors. (Problem proposed by P. Francini)