\begin{center}
\includegraphics{drawG.1}
\end{center}

In the first test case, our boat is moving from point $(0, 0)$ to point $(9, 9)$. We pick up the 1st lifeboat while at $(3, 3)$ and pull it until we reach $(5, 5)$. Next, at $(6, 6)$, we catch the 3rd lifeboat and pull it until we reach $(7, 7)$. Then we immediately catch the 4th lifeboat and pull it to $(9, 9)$. At the final point, we pick up the 5th lifeboat and catch it immediately. After that, the machine stops working, and we have a score of 4.

In the second test case, our boat is moving from point $(0, 0)$ to point $(-5, 0)$. At point $(0, 0)$, we catch the 1st lifeboat and pull it towards us until we reach $(-1, 0)$; after that, we can try to catch the 2nd lifeboat, but we won't have enough distance to pull it towards us---the machine will end the game earlier, so the final score is 1.