Ways to Split Array Into Three Subarrays
Use prefix sums, then for each left cut binary search the range of middle cuts whose sums keep the order left at most middle at most right.
Use prefix sums, then for each left cut binary search the range of middle cuts whose sums keep the order left at most middle at most right.