Distributing Ballot Boxes#3067

Distributing Ballot Boxes

1 secondo
64 megabyte
Media

Today, besides SWERC'11, another important event is taking place in Spain which rivals it in importance: General Elections. Every resident of the country aged or older is asked to vote in order to choose representatives for the Congress of Deputies and the Senate. You do not need to worry that all judges will suddenly run away from their supervisory duties, as voting is not compulsory.

The administration has a number of ballot boxes, those used in previous elections. Unfortunately, the person in charge of distributing the boxes among cities was dismissed several months ago due to financial restrictions. As a result, the assignment of boxes to cities and the lists of people that must vote in each of them may not be ideal. Your task is to show how efficiently this distribution could have been done.

The only rule in assigning ballot boxes to cities is that each city must be assigned at least one box. Each person must vote in the box to which he or she has been previously assigned. Your goal is to find a distribution that minimizes the maximum number of people assigned to vote in any one box.

In the first example input case, two boxes go to the first city and the rest to the second, and exactly people are assigned to vote in each of the (huge!) boxes in the most efficient distribution. In the second case, , , , and ballot boxes are assigned to the cities, and people from the third city will be called to vote in each of the two boxes of their village, making these boxes the most crowded in the optimal assignment.

Input

The first line of each test case contains two integers: (1 \leq N \leq 500000) — the number of cities, and (N \leq B \leq 2000000) — the number of ballot boxes. Each of the next lines contains an integer a_i (1 \leq a_i \leq 5000000), the population of the -th city.

A single blank line will be included after each case. The last line of input contains -1 \text{ } -1 and should not be processed.

Output

For each case, your program should output a single integer: the maximum number of people assigned to one box in the most efficient assignment.

Esempi

Esempio 1

Loading
Loading