Classical Scheduling Problem

아직 제출이 없습니다시간 제한6초메모리 제한1024 MB

문제

You have tt minutes until a very important exam in a very important subject. You have a list of nn different topics of the subject, numbered from 11 to nn. It takes a_ia\_i minutes to learn the ii-th topic.

However, the subject is pretty complicated, and even if you learn some topic, you might not necessarily be confident about it during the exam. You know that to be confident about the ii-th topic, you need to learn at least b_ib\_i topics in total (including topic ii).

It takes no time to switch from one topic to another while learning. Thus, you have enough time to learn distinct topics p_1,p_2,,p_kp\_1, p\_2, \ldots, p\_k if a_p_1+a_p_2++a_p_kta\_{p\_1} + a\_{p\_2} + \ldots + a\_{p\_k} \le t, and you will be confident about topic p_ip\_i during the exam if kb_p_ik \ge b\_{p\_i}. Note that the order in which you learn the topics is not important.

You want to figure out what topics you should learn before the exam to maximize the number of topics you will be confident about.

입력

Each test contains multiple test cases. The first line contains the number of test cases qq (1q1041 \le q \le 10^4). The description of the test cases follows.

The first line of each test case contains two integers nn and tt, denoting the number of topics and the amount of time you have until the exam (1n21051 \le n \le 2 \cdot 10^5; 1t210141 \le t \le 2 \cdot 10^{14}).

The ii-th of the next nn lines contains two integers a_ia\_i and b_ib\_i, denoting the amount of time it takes to learn the ii-th topic and the total number of topics you need to learn to be confident about the ii-th topic (1a_i1091 \le a\_i \le 10^9; 1b_in1 \le b\_i \le n).

It is guaranteed that the sum of nn over all test cases does not exceed 21052 \cdot 10^5.

출력

For each test case, print the maximum number of topics you can be confident about during the exam.

Then print kk, denoting the number of topics you should learn, followed by kk distinct integers p_1,p_2,,p_kp\_1, p\_2, \ldots, p\_k in any order, denoting the indices of the topics you should learn (0kn0 \le k \le n; 1p_in1 \le p\_i \le n).

If there are multiple solutions, print any of them.

힌트

In the first test case, you should learn topics 11, 22, and 44. This will take you 20+40+30=9020 + 40 + 30 = 90 minutes, which is fine since you have 100100 minutes until the exam. Even though you will not be confident about topic 22 (you would need to learn all four topics for that), you will be confident about topics 11 and 44. It is impossible to be confident about more than two topics in this test case.