Gauss's law states that the electric flux \( \phi \) through a closed surface is \( \phi = \frac{q}{\epsilon_0} \). In this formula, \( q \) represents the net charge enclosed by the surface, and \( \epsilon_0 \) is the permittivity of free space. When multiple charges are present within the surface, their individual charges are summed to find the total charge. The charges provided are \( q \), \( -2q \), and \( 5q \). The total charge \( q_{{total}} \) enclosed is calculated as:
\[
q_{{total}} = q + (-2q) + 5q = 4q
\]
Consequently, the electric flux is determined by:
\[
\phi = \frac{q_{{total}}}{\epsilon_0} = \frac{4q}{\epsilon_0}
\]
The electric flux \( \phi \) passing through the closed surface is therefore \( \frac{4q}{\epsilon_0} \).