Answer
a) See the figures below.
b) See the detailed answer below.
Work Step by Step
a) We chose the system to be the upper magnet plus the lower magnet plus the table, as you see in the figures below.
b) We know that the system is at rest, so the net force exerted on it must be zero.
Thus, the net force exerted on any part of the system is zero too.
$$\sum F_{y, \;\rm Upper\;magnet}=F_{n1,\rm table}-F_{ \rm Lower\;magnet}-F_{G,\;\rm Upper\;magnet} =0$$
Plugging the known;
$$F_{n1,\rm table}-(3\cdot 2)-2=0 $$
$$F_{n1,\rm table} =8\;\rm N\tag 1$$
$$\sum F_{y, \;\rm Lower\;magnet}=F_{ \;\rm Upper\;magnet}-F_{n2,\rm table} -F_{G,\;\rm Lower\;magnet} =0$$
Plugging the known;
$$( 3\cdot 2)-F_{n2,\rm table} -2 =0 $$
$$F_{n2,\rm table}=-4\;\rm N\tag 2 $$
Note that $F_{ \;\rm Upper\;magnet}=F_{ \;\rm Lower\;magnet}=F_{pull}$ since they are action-reaction pair.
$$\sum F_{y,table}=F_{n2,\rm table}-F_{n,\rm ground}-F_{n1,\rm table}-F_{G,table}=0$$
Plugging the known, and from (1) and (2);
$$4-F_{n,\rm ground}-8-20=0 $$
$$F_{n,\rm ground}=24\;\rm N $$