K-th Largest Subarray Sum


Given an array with nn elements, what is the kk-th largest sub array sum. (A subarray sum is the sum of all elements within a continuous section of the array).

Input

The first line contain integers nn and kk. The second line contains nn integers a1,,ana_1,\dots,a_n, the elements of the array.

Output

Output the kk-th largest subarray sum.

Constraints

  • 1n1041 \le n \le 10^4
  • 1kn(n+1)21 \le k \le \frac{n(n+1)}{2}
  • 1ai1091 \le a_i \le 10^9

Example 1

Input 1
10 1
7 7 4 6 3 8 9 8 5 1 
Output 1
58

Example 2

Input 2
3 4
8 10 4 
Output 2
10

Example 3

Input 3
5 6
3 6 9 8 4 
Output 3
18

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.