Math olympiad question how to solve for a and b