Problem 2439 · Medium
Binary search the largest allowed value and check that every prefix sum fits within it times its length.
Open the interactive visualisation