Let [a,b]=x, and (a,b)=y. It is known (and easy to prove) that ab=[a,b]⋅(a,b), so ab=xy. Then the initial equation can be rewritten in the form
xy=300+7x+5y⇔xy−7x−5y+35=335⇔x(y−7)−5(y−7)=335⇔(x−5)(y−7)=5⋅67.
Factors on the left-hand side are nonnegative integers, and since x=[a,b]≥(a,b)=y, we have (x−5)>(y−7). So we have two possibilities.
1) x−5=67 and y−7=5. Then x=72 and y=12. It means that a=12n, b=12m for some relatively prime n,m, and ab=xy=72⋅12, i.e. 12n⋅12m=72⋅12, thus nm=6. Taking into account that a≤b and so n≤m, we obtain n=1,m=6. Therefore a=12,b=12⋅6=72, or n=2,m=3, so a=12⋅2=24, b=12⋅3=36.
2) x−5=335 and y−7=1. Then x=340 and y=8. But it is impossible since [a,b]=x must be divisible by y=(a,b), but 340∤8.
Therefore, we have two required pairs (12,72), (24,36).