Parallel Sums
From Codeforces. Geometry. Solve the geometry problem "Parallel Sums".
Examples
Input: [1,2,3]
Output: 0
Input: [2,3,4]
Output: 0
Hints
Express a_i via first element and differences d_i = a_i - a_{i-1}. Sliding window sums give linear constraints on differences.
Whole array determined up to one additive degree of freedom. Range max depends on cumulative sum of differences within that range.
"Unbounded" when query range doesn't intersect every sliding window — some elements isolated from constraints can be driven arbitrarily negative.
Parallel Sums
**From Codeforces.** Geometry. Solve the geometry problem "Parallel Sums".