Untitled
unknown
python
4 years ago
516 B
6
Indexable
def compute(sx, sy, tx, ty):
while tx >= sx and ty >= sy:
if tx == ty:
break
elif tx > ty:
if ty > sy:
tx %= ty
else:
return (tx - sx) % ty == 0
else:
if tx > sx:
ty %= tx
else:
return (ty - sy) % tx == 0
return tx == sx and ty == sy
def reachingPoints(a, b, c, d):
ans = compute(a, b, c, d)
if ans:
return 'Yes'
else:
return 'No'Editor is loading...