The exponent of a prime in the HCF is the MINIMUM of the exponents of $p$ in the various numbers.. The exponent of $p$ in the LCM is the MAXIMUM of the exponents of $p$ in the various given numbers.
The $\min$, $\max$ information is not always sufficient to determine the prime power factorization of $n$, as I mentioned in a remark at the end. But it is enough for the particular question you asked.