A metal received light with wavelength $300~\mathrm{nm}$ in experiment A and light with wavelength $500~\mathrm{nm}$ in experiment B. In one experiment the electron speed was twice the speed of that in the other experiment. Calculate the velocities and the work function ($W$) of the metal.
Because it's the same metal in both experiments we have $W_\mathrm{A} = W_\mathrm{B}$, which means that $E_\mathrm{A} - K_\mathrm{A} = E_\mathrm{B} - K_\mathrm{B}$.
We know that $E=hc/\lambda$ and $K=mv^2/2$. Because $\lambda_\mathrm{A} < \lambda_\mathrm{B}$, we have $E_\mathrm{A} > E_\mathrm{B}$ and $K_\mathrm{A} < K_\mathrm{B}$ which means $v_\mathrm{A} < v_\mathrm{B}$ and $v_\mathrm{B} = 2v_\mathrm{A}$.
Then I made the substituions in my initial equality but when I try to calculate $v_\mathrm{A}$ I obtained a negative number inside my root.