Solution:
The answer is (D). Let us examine Francesco's situation: for the system to admit infinitely many solutions it is necessary that the second equation be equivalent to the first, that is, that they differ at most by a multiplicative constant. The constant term of the second equation is 362=181×2, so in Francesco's case the coefficients of the second equation are twice those of the first, that is, g=26 and m=2. Francesco was born on February 26th.
In Andrea's case, instead, the two equations must be incompatible, and this happens when the coefficients of the unknowns are proportional to each other but the proportionality factor is not the same as that between the respective constant terms. This means that for Andrea g=13 m. Since g≤31, two values of m are possible: 1 and 2. However, for m=2 the system has infinitely many solutions, so Andrea was born on January 13th.
Note that it is also possible to approach the problem geometrically, interpreting the equations as lines in the Cartesian plane and the solutions of the system as their intersections. In Francesco's case the two equations must represent the same line, while in Andrea's case they must represent two parallel but distinct lines. The conclusions are, of course, the same.