Can someone explain the Lunchtime DLINE problem test cases specially the last one from sample input and output.

From the problem statement what I’ve understood is that we have to draw these lines parallel to y-axis, we can move pencil in two ways:

(1) move it towards x axis both +ve and -ve x.

(2) move pencil in +ve y only but first bring it to zero x coordinates.

and 1 unit of time is used to move each changing x and y coordinates, we’ve a limit of time and to draw maximum complete line segments out of these operations.

With this explanation (what I’ve understood) I couldn’t solve the given test cases properly.

Can someone explain it a bit. Just a small Hint or missing point would do the job.

Thank you for your attention.