Simple math will do. Hint: you may start with working on the "faster" guy. Try to find out the relationship between the number of loops he travels and the number of times they meet. (That's my approach )
From http://uvatoolkit.com/problemssolve.php, I know this problem could be solved by gcd or other math methods. However, I didn't know how to use them for this problem. Could someone please give me more hints? Thanks.