A pipeline monitor logs n consecutive flow adjustments; adjustment i changed throughput by the integer a[i] (which may be negative). Given a target t, find the length of the longest contiguous stretch of adjustments whose values sum to exactly t. If no non-empty stretch sums to t, output 0.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the adjustments in order.
Line 3: an integer t.
Output format
A single integer: the length of the longest contiguous stretch summing to exactly t (0 if none exists).
Constraints
- 1 <= n <= 100000
- -1000000 <= each adjustment <= 1000000
- -100000000000 <= t <= 100000000000