Satish wants to prepare for tommorow's exam . He knows the distribution of marks for the subject along with time to learn the concepts.
You are given remaining time for the exam along with marks for each topic and passing marks for the subject.
Find the max marks Satish can attain by studing max no of topic in max no hours not excedding (p) .
The first line of input contains the number of testcases t.
The first line of each testcase contains the no of topics(n) , time remaining for exam(h) in hour and passing marks(p).
Each 'n' lines contain u(time to learn topic) and v(weightage of topic in exam) .
For each test case print "YES" along with time taken or "NO".
Sample Input 0
5 40 21
Sample Output 0
Marks needed to pass the subject 10 +10 + 3 = 23
Time taken to achieve the 23 marks : 12 + 6 + 8 =36
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.