You mixed up power and voltage gains. As per the question Power amplification is:

$$ 10 log (P_o/P_i) = 30 DBs $$
Since P is proportional to \$ V^2 \$  , we can also write:
$$ 10 log (V_o^2/V_i^2) = 30 DBs$$
Or
$$ 20 log (V_o/V_i) = 30 DBs$$
$$ i.e., log (V_o/V_i) = 1.5 DBs$$
Therefore the corresponding voltage amplification is:
$$ (V_o/V_i) = 10^{1.5} = 31.62$$