
Let 'N' = 3, 'X' = 13, 'L' = [2, 3, 5], 'R' = [4, 5, 7].
We can assign 2 marks to the first student, 5 marks to the second student, and 5 marks to the third student.
So the median mark is 5 which is the maximum possible.
First-line contains an integer 'T', which denotes the number of test cases.
For every test case:-
First-line contains two integers 'N' and 'X'.
Second-line contains 'N' space-separated integers, the elements of the array 'L'
Third-line contains 'N' space-separated integers, the elements of the array 'R'.
For each test case, Return the maximum median marks you can obtain.
You don’t need to print anything. Just implement the given function.
1 <= 'T' <= 10
1 <= 'N' <= 10^5
1 <= 'L[i]' <= 'R[i]' <= 10^5
1 <= 'X' <= 10^8
'N' is odd.
The Sum of 'N' overall test cases does not exceed 10^5.
Time Limit: 1 sec
Approach:-
Algorithm:-
=> helper function:-
Student Percentile Calculation
Player Leaderboard Sorting
Minimized Maximum of Products Distributed to Any Store
Minimal Character Reassignment
Unique Gift Packing