You are viewing a single comment's thread. Return to all comments →
It is because this problem was derived from this formular:
a + Nx = b + Ny
if N is positive integer, kangaroos jump to same point when they jump N times. Above formular can be derived into:
N = (a - b) / (y - x)
So, the condition, you said, is to check if N is positive integer.
Seems like cookies are disabled on this browser, please enable them to open this website
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
It is because this problem was derived from this formular:
a + Nx = b + Ny
if N is positive integer, kangaroos jump to same point when they jump N times. Above formular can be derived into:
N = (a - b) / (y - x)
So, the condition, you said, is to check if N is positive integer.