Find the remainder in the division of $3^{385}$ by $400$.
What I thought:
I'm looking for the smallest $r$ such that $3^{385} \equiv r \pmod {400}$. Which is equivalent to the system $\begin{cases} 3^{385} \equiv r \pmod {2^4} \\ 3^{385} \equiv r \pmod {5^2}\end{cases}$. Obviously, $3^{385} \equiv 1 \pmod {2}$. Using Fermat's Little Theorem, $3^{385} \equiv 3^1 \pmod {5}$ since $385 \equiv 1 \pmod 4$. However, I'm not sure how to extend this to the original system. I've figured that $r \mod 2^4 \in \{1,3,5,7,9,11,13,15\}$ and $r \mod 5^2\in \{3,8,13,18,23\}$. But how do I know which?
Thanks for the help!!
Edit: Look, I should have clarified this earlier: there are too many ways to solve this, and I in fact know many of them. What I need is a follow up on what I have done. How do I solve the system of congruences when the factors of the original modulus are powers?