atcoder#ABC297E. [ABC297E] Kth Takoyaki Set

[ABC297E] Kth Takoyaki Set

Score : 500500 points

Problem Statement

In AtCoder Kingdom, NN kinds of takoyakis (ball-shaped Japanese food) are sold. A takoyaki of the ii-th kind is sold for AiA_i yen.

Takahashi will buy at least one takoyaki in total. He is allowed to buy multiple takoyakis of the same kind.

Find the KK-th lowest price that Takahashi may pay. Here, if there are multiple sets of takoyakis that cost the same price, the price is counted only once.

Constraints

  • 1N101 \le N \le 10
  • 1K2×1051 \le K \le 2 \times 10^5
  • 1Ai1091 \le A_i \le 10^9
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN KK

A1A_1 A2A_2 \dots ANA_N

Output

Print the answer as an integer.

4 6
20 25 30 100
50

The four kinds of takoyakis sold in AtCoder Kingdom cost 2020 yen, 2525 yen, 3030 yen, and 100100 yen.

The six lowest prices that Takahashi may pay are 2020 yen, 2525 yen, 3030 yen, 4040 yen, 4545 yen, and 5050 yen. Thus, the answer is 5050.

Note that at least one takoyaki must be bought.

2 10
2 1
10

Note that a price is not counted more than once even if there are multiple sets of takoyakis costing that price.

10 200000
955277671 764071525 871653439 819642859 703677532 515827892 127889502 881462887 330802980 503797872
5705443819