Change r to 1e18 and it works. This is for the case when there's $(999999999, 10^9)$ and $(10^9, 1)$.
r
1e18
Change
rto1e18and it works. This is for the case when there's $(999999999, 10^9)$ and $(10^9, 1)$.