CSES - KILO 2017 4/5 - Uolevi and Market
  • Time limit: 2.00 s
  • Memory limit: 512 MB

Uolevi always goes to dinner at the Market. There are nn kinds of food sold. These foods are numbered from 11 to nn. The price of one piece of ii-th food is pip_i.

Every night, Uolevi will choose a non-empty set of foods and eat one piece of each food in this set. Uolevi likes new things. So he won't choose the same set in two different nights. Besides this, because Uolevi is poor, each night he will choose the cheapest food set that he didn't choose before.

Now, you are given a positive integer kk. Can you tell Uolevi which set of foods he will choose on kk-th day? You only have to tell him how much he will spend on this day.

Input

The input consists of two lines. The first line contains integers nn and kk. The second line consists of nn integers p1,p2,pnp_1, p_2, \ldots p_n.

Output

Output one number, how much Uolevi will spend on food on kk-th day.

Constraints

  • 2n21052 \le n \le 2 \cdot 10^5
  • 1kmin(106,2n1)1 \le k \le \min(10^6, 2^n - 1)
  • 1pi1081 \le p_i \le 10^8

Examples

Input:

5 30
4 2 1 16 8

Output:

30

Input:

4 5
1 1 2 2

Output:

2