Its time for our Annual TechFest and Tech enthusiasts from all over the North India will be participating. We are happy that team from other states are also coming but the problem is arranging their accomodation.
There are total g Institutes participating. People from each Institute will come in their own team of n members. TechFest's Hospitality Team have r empty rooms for accomodation.
Cond 1: Room allocation will start at the arrival of ith team and will stop after accomodating jth team.Its on you to choose values of i and j. here 1<=i<=j<=g
Cond 2: Our Institute authority raised a condition for us that each room must have equal number of students( say k) in it but its on us to decide how many students we want to put in a room.
your aim is to find maximum number of students that we can put in a room, given we satisfy above two conditions
Note: One team can stay in multiple rooms. similarly multiple teams can share one room.
Score= max(0, x), where x = (500- num of characters in code)/5
Input:
First line contains no. of test cases. For each test case we have 2 lines of input , first line contains number of rooms available(r) and no of Institutes participating(g). On second line we have g space separated numbers denoting the no of students in each group(n).
Output:
For each test case, Ouptput the maximum number of students that can be accomodated in each room following the above conditions. If no accomodation is possible, output 0.
Constraints:
1<=g<=100000
1<=n<=100
1<=i<=j<=g
1<=r<=100
Example:
input
1
3 8
2 7 3 4 4 5 3 6
output:
6
explanation:
Taking i as 2 and j as 5, the in between groups contain following no. of members {7, 3, 4, 4}
sum=7+3+4+4=18
student in each room, k=18/3=6