Suppose we have two relatively prime integers $a$ and $b$. Now, suppose that for some $x$ we have $x \equiv A \pmod{a}$ and $x \equiv B \pmod{b}$. Is there any way we can express $x \pmod{a \cdot b}$ in terms of $A$ and $B$? Also, can we do something similar for $x \pmod{a^n \cdot b^m}$ where $n, m\in \mathbb{Z}_{>0}$?
I suppose this would involve solving the congruence relation $(x-A)^n(x-B)^m \equiv 0 \pmod{a^n \cdot b^m}$, but I have no clue as to what to do with this...