Lane Switching

I’m attempting this problem: this, and my code is here.

However, it seems to WA on the third test case, right after the 2 sample test cases.
What it tries to do is binary search on the maximum safety factor, and then sort of “expands” the cars, so all the ACM has to do is fit between them. For simplicity, only the middle of the car is considered so that the ACM can be thought of as a point.

I’ve tried all the test cases I could think of, and they all yielded correct answers.

Any help?

Try stress testing against the provided solution.

For me the solution was checking minimum distance in the starting position.