https://codeforces.com/problemset/problem/217/A

I didn’t really understand the editorial. Can someone please explain it to me?

Basically the person here needs to reach the final co-ordinate form the initial as given in each test case.
Now, there are some random drifts(turns) always occurring in that place which will never help him reach the destination(as it is the only mode of transportation or a force to drag him), now he observes the pattern and heaps up (here it means observes ) those drifts which occur only in the integer co-ordinates( e.g (2,3) , (4,5) , (8,1)…) and he uses those drifts that will help him reach the destination that means he only takes the useful turns(if required) that are least possible.
The test cases will help u understand more clearly as in the 1st one he only needs 1 turn to reach from (2,1) to (1,2) and in the 2nd one no turn is required so no. of drifts used is 0.

Hope you understand, good luck.