Reaching Points

On a 2D plane, start at (sx, sy). In one move, you may perform either operation:

  • (x, y) -> (x + y, y)
  • (x, y) -> (x, x + y)

Given four positive integers sx, sy, tx, and ty, determin...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: