Oree's Candies


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Java, Python

Oree's white van recently broke down, hindering him from selling candies in his local neighbourhood. Without any other form of transport, he has no choice but to carry the candies in a bag and walk around with them.

Oree, being a wizard, has crafted some very special candies. They are super flavourful, and some candies are more flavourful than others. The more flavourful a candy is, the more addictive, and hence, the higher likelihood that he will get repeat customers. However, without his white van, he cannot deliver as many candies as before.

He sets himself a goal to sell candies that have a combined total of q flavour factor. No more, no less. He also wants to carry the least amount of candy needed to achieve this, since he doesn't want to carry too many candies.

Input

The first line contains two integers n (1 \leq n \leq 100) and q (1 \leq q \leq 10^4), the different flavour factors of candies available, and the flavour goal to meet.

The next line contains n integers f_i (1 \leq f_i \leq 10^4), the flavour factors available. The provided flavour factors are unique (i.e., there are no duplicates).

Output

Output the number of candies he needs to carry in order to meet his flavour factor goal. If it's not possible to achieve this goal, output -1.

Example

Input 1
4 20
1 4 6 8
Output 1
3

Oree can get two candies with a flavour factor of 8 and one candy with a flavour factor of 4 to reach his goal of 20 total flavour factor.

Input 2
1 3
2
Output 2
-1

It is not possible to get exactly 3 total flavour factor with candies that have a flavour factor of 2.


Comments

There are no comments at the moment.