AlgoUniversity
  • Go Back
Discussion
Rainy Day :

Author

Akshay Sharma

Difficulty Level : Easy

Submissions : 69

Asked In : Tiktok

Marks :100

: 0 | : 0

Today is raining in the city Given an array of umbrellas of size N. umbrella[i] means the number of people that it can cover. Find the minimum number of umbrellas needed to cover exactly the amount of people X. If not possible, return -1.

Input

The first line of input contains two integers N and X the number of umbrellas and people needs to cover ($$$1 \le N \le X\le 100000$$$).

The next line contains N space integers of the array.

Output

Print the minimum number of umbrellas needed to cover all X persons or print -1

Examples

Input
5 12
1 2 4 11 8
Output
2
Input
3 11
1 4 4 
Output
-1

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.