SP301 BOOK - Booklets
Description
Bob has a difficult job. He must distribute advertising booklets for extra school activities in different schools. The booklets have different number of pages. Bob has a list with the number of pages of each booklet and the number of schools that he must visit. He has to distribute the booklets such that each school gets a number of booklets equal to either the lower integer part (LIP),or the upper integer part (UIP) of the number of booklets divided by the number of schools. Poor Bob must obey other rules too. He must distribute all the **UIP** number of booklets first and then the **LIP** number of booklets.
Any booklet **A** that is distributed to a school **S\_i** must have fewer or at most an equal number of pages that any other booklet B that is distributed to a school **S\_j**, if **S\_i** gets the booklets before **S\_j** (i.e if **i** < **j** then **pages(A)**
Input Format
The input starts with a line containing a single integer **t**
Output Format
For each set of data the program prints the result to the standard output on a separate line. The solution is represented by the number of pages of the first booklet distributed to the specified school.