Hi,
I am trying to solve this problem by simulating collisions with the table's borders. But this approach gets TLE. What other approach can I use? Maybe some math?
Thank you.
11657 - Rational Billiard
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11657 - Rational Billiard
start with the gcd(n, m)
Check input and AC output for thousands of problems on uDebug!