It might be interesting to note, OP, that even if there was a simpler method for finding X and Y in your equation, that there is not one unique solution. There are in fact INFINITELY many solutions. You may use the regular euclidian algorithm to find one solution.
If you use the regular algorithm, and get a solution(x,y). Then there are other solutions of the form

where k is a member of the integers. There are in fact infinitely many integers, and hence there are infinitely many solutions so such an equation.
Hence, even if there was a simpler method, it might take you infinitely many recursions until you got to your desired answer. In your example: (y=10,x=5). Although I do realise that your grid limits the solutions such that the integers are confined to your grid, so perhaps it's not such an impractical endeavour.
If you would like further explanation on how to solve you problem using the regular euclidian algorithm, then just ask.