At UFBA, a student group is organizing a festival menu and wants to measure the strength of different consecutive stretches of dishes. For each position $$$i$$$, the value $$$A_i$$$ represents how much that dish contributes to the overall dendê power of the menu. The power of a contiguous segment is the sum of all values inside it.
Everyone already knows how to find the single strongest segment. But for the final ranking, the organizers need more than just the best one: they want the $$$K$$$-th strongest segment.
Can you help them find the power of the $$$K$$$-th strongest segment?
The first line contains two integers $$$N$$$ and $$$K$$$ ($$$1 \leq N \leq 10^{5}$$$, $$$1 \leq K \leq \frac{N(N+1)}{2}$$$).
The second line contains $$$N$$$ integers $$$A_1, A_2, \dots, A_N$$$ ($$$-10^{9} \leq A_i \leq 10^{9}$$$), where $$$A_i$$$ is the dendê power contribution of the $$$i$$$-th dish.
Output a single integer: the power of the segment that should appear in the $$$K$$$-th position of the ranking.
3 42 -1 3
2
4 7-5 4 -2 3
-1
3 51 1 1
1