a) Obviously k=1 fails (e.g., whenever a couple of neighbors share their favorite number). We will show that k=2 works. If all of them share the same favorite numbers, say 1 and 2, then we can easily solve the problem via providing 7 T-shirts of each kind, since 14 is even. If this is not the case, WLOG we can order the participants, such that the first one has a favorite number A, which is not among the favorites of the last one. Then we give an A T-shirt to the first. For each consecutive participant, we choose a favorite number, different than the one ahead of him. This will always be possible, thus the answer is k=2.
b) First, k≤3 fails when the favorite numbers of both boys and girls form the triples {1,2,3}, {1,4,5}, {1,6,7}, {2,4,6}, {2,5,7}, {3,4,7}, {3,5,6}. We will show that k=4 works. It is enough to consider exactly 4 favorite numbers for each of the boys, and all the different ways to assign a symbol B or G to each of the numbered T-shirts, for which there are no T-shirts with different symbols but identical numbers. Such a labeling will be referred as "good". Note that, there are at least 24=16 "good" labelings (when all the girls and all the boys share the same set of favorite numbers), and the probability for a boy to have all his favorite T-shirts labeled G is exactly 161 from all good cases. Analogously, for a girl to have B on all her favorite T-shirts. Therefore, in at most 14⋅161=87 of the "good" cases the organizers will fail to distribute the T-shirts; hence in at least 81 of the good cases (in particular, in at least two) the organizers can accomplish their goal.