Can someone help me with this problem -
There is a school in a village. It has N classes. One fine day, someone donated B blue berry cheese cakes to schools. Now you need to divide these cakes such that:
Each class gets at least 1 cake.
Each class will share the cake(s) among students.
Your aim is to minimize the maximum number of students per cake in any class.
The first line of the input contains two space separated integers N and B denoting the number of classes and total number of blue berry cheese cakes, respectively.
Next N lines contain number of students in each class.
For each test case, output the maximum number of students who will share a cake.
2 <= N <= 5105 N <= B <= 2106 1 <= number of students in ith class <= 5*106
Sample Input 1 2 35
Sample Output 18
Sample Input 2 7 20 50
Sample Output - 2 10
what would be answer for
8 17 3 5 2 6 5 10 7 4
my answer is 3