- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
- Saman: yo! let me send you this awesome track!
- Erfan: thanks man, I’m at work now. I’ll listen to it when I get home.
Erfan is going to a trip for Norooz holidays and wants to enjoy some music of a genre named “Khaltoor” on his way. He wants to ask his friend Saman to make a CD for him containing this type of music. The CD has maximum capacity of \(M\) minutes. Saman has \(N\) music tracks and needs your help to write maximum number of tracks into the CD.
ورودی
In the first line there will be an integer \(T\) indicating the number of test cases. \[1 \leq T \leq 100\]
Each test case begins with two integers \(N\) and \(M\) indicating the number of tracks and the capacity of the CD. \[1 \leq N \leq 10^5\] \[1 \leq M \leq 10^9\]
The following \(N\) lines containing an integer \(t_i\) indicating the length of each track. \[1 \leq t_i \leq 10^9\]
خروجی
For each test case, print an integer indicating the maximum number of tracks that Saman can write on the CD.
مثالها
ورودی نمونه ۱
1
6 12
13 5 10 3 4 11
خروجی نمونه ۱
3
ارسال پاسخ برای این سؤال