If the least common multiple of two 6-digit integers has 10 digits, then their greatest common divisor has at most how many digits?
I can not figure out a way to solve this. I thought that the answer might be $6+6-10=2$, but that is clearly wrong. I also tried coming up with various examples but to no avail. Is there a rigorous way to solve this without guessing?
Hint: for any two positive integers $m,n$ we have $m\times n=\gcd(m,n)\times\mathrm{lcm}(m,n)$.