<s>[INST] When does $\frac{a+b}{2}$ and $\sqrt{ab}$ have inversed tens digits and ones digits? Let $a$ and $b$ be natural numbers, and

$$A = \frac{a+b}{2}$$
$$B = \sqrt{ab}$$

It's given that $A$ and $B$ are two-digit numbers such that the tens digit of $A$ is the same as the ones digit of $B$, and the tens digit of $B$ is the same as the ones digit of $A$.

So $A = 10x + y\;\,$and$\;B = 10y + x$.

Also given is $A\ne B$.

What is $a$ and $b$?

My teacher gave us the answer without explaining it as: $a = 98$ and $b = 32$, which makes $A = 65$ and $B=56$.

My question is: How do you prove this? I know $98 = 2\cdot 7^2$ and $32 = 2^5$, but I don't understand how to find this specific answer.
 [/INST] Note that $$A+B = 11(x+y)$$
and $$A-B = 9(x-y)$$
where $$1\le y \le x \le 9$$
Considering all our options, we see $x+y=9$ and $x-y=1$ provides the  given solution of A=54 and B=45.  
</s>