USACO Sabotage

Problem Link: USACO

Editorial: Contest Results

This problem is in the binary search section of the USACO Guide. In the editorial, I’m not able to understand what it means to check “if a subarray has a positive or negative average”, or “the sign of the average of all elements not in a subarray”

Edit: I finally understood the process to check if Farmer Paul could make all the machines have an average greater than or equal to a value b. My next question is as follows: Why can we binary search on this? I’m not completely positive on wether or not this is truly a monotonic function.

Clearly if a subarray has average at least b then it has average at least b' for any b\ge b'.