Reaching point problem Leetcode

I was going through different approach than recursion and found a code in discussion page. Can u help me understand a part of code in this

ques-> https://leetcode.com/problems/reaching-points/

code->https://ide.codingblocks.com/s/225476

i want to know what’s the use of the multiplication term in this?

@mikkyimran
ok, So lets try to remove the multiplication term.
Is the solution still correct? Yes it is.
It would still give correct result. But the numbers are of order ~10^9. It would result in TLE. (consider 1,10^9 ,you would keep on subtracting ) https://ide.codingblocks.com/s/226190
Instead we subtracts multiples of the other number, to reduce the time complexity.
we try to remove multiples of tx to cover (ty- max(tx, sy)) this much distance in a single iteration.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.