a and b. In one move you add the value of one counter to the other: the pair (p, q) becomes either (p + q, q) or (p, p + q).
Return True if some number of moves (possibly zero) turns the counters into the pair (x, y), in exactly that order, and False otherwise.a=2, b=3, x=8, y=11 → True
(2, 3) → (5, 3) → (8, 3) → (8, 11).
a=1, b=2, x=4, y=4 → False
Every move leaves one number strictly larger than the other, so two equal numbers can only be had if you started with them.
a=3, b=5, x=3, y=5 → True
a=2, b=3, x=8, y=11
True
Run checks the first 3 tests in your browser. Submit checks all 104 tests on the server, hidden ones included.