Solution (source code)

= Solution

Factorization over $K$ gives the orbits of the <Galois group> on the three resolvent roots. If $Q$ splits completely, the quotient is trivial and $G=V_4$. If $Q$ is a linear factor times an irreducible quadratic, the quotient is $C_2$ and $G=D_8$.

If $Q$ is irreducible, the quotient acts transitively on three roots, so it is $C_3$ or $S_3$. The product of their pairwise differences is a square root of the nonzero <discriminant> $\Delta$ and changes by the sign of the <permutation>. Thus $\Delta$ is a square in $K$ exactly when the quotient contains only even <permutations>. The criterion is
$$
\boxed{\begin{array}{c|c}
\text{factorization and discriminant of }Q&G\\\hline
\text{three linear factors}&V_4\\
\text{linear times irreducible quadratic}&D_8\\
\text{irreducible, }\Delta\in K^{\times2}&A_4\\
\text{irreducible, }\Delta\notin K^{\times2}&S_4
\end{array}}
$$
The assumed containment of $V_4$ is essential to reconstruct $G$ from the quotient by this table.