A reactor logs n consecutive coolant flow deltas; delta i is the integer a[i] (which may be negative when coolant is drawn off). You want to purge over the shortest possible contiguous window whose delta values sum to at least the threshold t. Report the length of the shortest non-empty contiguous window with sum >= t, or 0 if no window reaches the threshold.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the deltas in order.
Line 3: an integer t, the threshold.
Output format
A single integer: the length of the shortest contiguous window whose sum is at least t (0 if none exists).
Constraints
- 1 <= n <= 100000
- -1000000 <= each delta <= 1000000
- -100000000000 <= t <= 100000000000