10627  Infinite Race
Moderator: Board moderators
10627  Infinite Race
Hi!
I tried to code this task on the contest but got WA.
Later I rewrote this task (this time without using any floats etc) and still got WA..
Does anyone have any tricky inputs for this task ??
Thanks in advance
Good Luck
I tried to code this task on the contest but got WA.
Later I rewrote this task (this time without using any floats etc) and still got WA..
Does anyone have any tricky inputs for this task ??
Thanks in advance
Good Luck

 Guru
 Posts: 724
 Joined: Wed Dec 19, 2001 2:00 am
 Location: Germany

 Guru
 Posts: 724
 Joined: Wed Dec 19, 2001 2:00 am
 Location: Germany
more test cases
can somebody give me more test cases .
thanx in advance.
ranjit.
thanx in advance.
ranjit.
Re: more test cases
Could someone offer some idea to solve the problem?ranjit wrote:can somebody give me more test cases .
thanx in advance.
ranjit.
Thx
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 )
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Can someone give me the correct output of the input in the following ?
thanks!
thanks!
Code: Select all
50 32 35 20
100 22 13 31
24 12 41 15
467 35 231 122
36 12 24 24
0 1 2 3
studying @ ntu csie
Re: 10627  Infinite Race
Code: Select all
14
6
26
61
12
Re: 10627  Infinite Race
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.