Nikit has to give a short contest of duration "N" minutes. The contest is divided into 2 sections-Easy and Hard. X and Y marks will be awarded per problem for Easy and Hard respectively. Assume that he will take P minutes to solve an Easy problem and Q minutes to solve a Hard problem successfully.
There are A and B number of Easy Hard problems respectively. Calculate how many problems of a particular section should he perform to get the maximum score in time.
Note: Assume he will always try to solve the easiest problem.
The first line of input contains an integer T denoting the number of test cases. T-test cases follow.
For each test case, print number of Easy and Hard problems should be solved by Nikit.
1 ≤ T ≤ 10
10 ≤ N ≤ 1000
1 ≤ X < Y ≤ 100
1 ≤ A, B ≤ 100
1 ≤ P < Q ≤ N
Case 1: Maximum marks get scored when he solves 1 easy and 4 hard problems.
Case 2: Maximum marks gets scored when he solves 5 easy problems or 1 easy and 2 hard problems or 3 easy and 1 hard problem. But he always try to solve the easiest problem therefore solves 5 easy problems.
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.