Two equations, two variables, we can solve this using algebra. The machine is valid if the solutions are integers. It did take me three pages of scribblings to resolve the equations.
Added an optional correction factor to Machine#initialize
and ran everything
else the same.