i dont think its possible to solve an equation with 2 variables, unless you had another equation, so you could solve them simultaneously....could be wrong though.
I think, as you said, guessing and checking i the only way, as they specify a and b are integers