Sabotage USACO Gold P2 2014

Listed under the binary search topic in the guide. I don’t understand what the solution ( is trying to say. The solution is binary searching for the answer, but how is the check() function working? Please let me know.

Hint: Rewrite the condition of the check function as a mathematical formula, then rearrange the inequality.