لینک‌های مفید برای شرکت در مسابقه:

در طول مسابقه، می‌توانید سؤالات خود را از قسمت «سؤال بپرسید» مطرح کنید.

F – Khaltoor


  • محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

  • 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 MM minutes. Saman has NN music tracks and needs your help to write maximum number of tracks into the CD.

ورودی🔗

In the first line there will be an integer TT indicating the number of test cases. 1T1001 \leq T \leq 100

Each test case begins with two integers NN and MM indicating the number of tracks and the capacity of the CD. 1N1051 \leq N \leq 10^5 1M1091 \leq M \leq 10^9

The following NN lines containing an integer tit_i indicating the length of each track. 1ti1091 \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
Plain text

خروجی نمونه ۱🔗

3
Plain text
ارسال پاسخ برای این سؤال
در حال حاضر شما دسترسی ندارید.