
Assume that taxis can run simultaneously and there is no waiting period between trips. There may be multiple taxis with the same time cost.
If ‘X=3’, ‘N=2’ and ‘taxiTravelTime=[1,2]’,
Then the answer is 2. This is because the first taxi (index 0, cost 1) can make two trips costing 2 minutes, and the second taxi can make a single trip costing 2 minutes simultaneously.
First-line contains 'T,' denoting the number of Test cases.
For each Test case:
The first contains two integers, 'X' denoting the number of trips and ‘N’ representing the number of taxis available.
The second line contains ‘N’ integers denoting the ‘taxiTravelTime’ array.
You must print the minimum required time to make ‘X’ trips.
Print the output of each test case in a new line.
1<= T <=10
1<= X <=10^9
1<= N <=10^5
1<= taxiTravelTime[i] <=10^9
Time Limit: 1 sec
Element Count in Ranges
First Digit One
Minimize Maximum Adjacent Distance
Sorted Doubly Linked List to Balanced BST
Minimized Maximum of Products Distributed to Any Store