By condition it follows that one of the numbers is divisible by 5. Moreover, exactly one of the numbers is divisible by 5, otherwise (a,b) and 90(a,b) are divisible by 25, and so 160 is divisible by 25, a contradiction. Let without loss of generality a=5, b=5. Then a=5c, (a,b)=(5c,b)=(c,b), and the equation can be rewritten as bc=32+18(c,b). Since bc and 18(c,b) are divisible by (c,b), it follows that (c,b) is a factor of 32, i.e. (c,b)=1,2,4,8,16,32.
If (c,b)≥4, then bc is divisible by 42=16, so 18(c,b)=(bc−32)=16, and, therefore, (c,b)=8. Thus bc=64, i.e. 18(c,b)=32. Therefore, (c,b)=16. If either (c,b)=16 or (c,b)=32, then bc=162, but bc=32+18⋅16 or bc=32+18⋅64, which are impossible. Hence (c,b)≤2, i.e. is equal to either 1 or 2.
1) Let (c,b)=1. Then bc=50, and at least one of the numbers is odd. Since b=5, we find that either c=25 and b=2 or c=50 and b=1. This gives the solutions of the initial equation: (a,b)=(125,2) and (a,b)=(250,1).
2) Now let (c,b)=2. Then bc=32+36=68. Set b=2b1, c=2c1, where b1 and c1 are coprime. Then b1c1=17. Hence either c1=1 and b1=17 or c1=17 and b1=1. This gives the solutions of the initial equation: (a,b)=(10,34) and (a,b)=(170,2).
Since the initial equation is symmetric with respect to a and b, we have four more solutions: (34;10), (2;125), (2;170), (1;250).