Strange Bar

Given N kettle volumes and K people, find the largest integer amount X such that the sum over all kettles of floor(volume / X) is at least K.

Medium5Binary searchArrayGreedyMathInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

The day before a programming contest, Eunsang and his friends met at a strange bar. At this bar every kettle of makgeolli is the same size, but the amount of makgeolli inside is random. One order might come with 802 ml, and another with 1002 ml.

Eunsang orders NN kettles of makgeolli and wants to give the same amount to each of the KK people in the group, himself included. Eunsang and his friends do not like mixing makgeolli from different kettles. So if some makgeolli is left in a kettle after pouring, they throw it away. Leftovers from several kettles are never combined and poured again.

For example, suppose 5 people order 3 kettles holding 1002 ml, 802 ml, and 705 ml. If each person gets 401 ml, they throw away 200 ml, 0 ml, and 304 ml from the three kettles.

Find the largest amount (in ml) that every one of the KK people can receive, with each person getting the same amount. The amount per person is a whole number of ml.

Input

The first line contains NN, the number of kettles Eunsang ordered, and KK, the number of people including Eunsang.

Each of the next NN lines contains the amount of makgeolli (in ml) in one kettle.

  • 1N100001 \le N \le 10\,000
  • 1K10000001 \le K \le 1\,000\,000
  • NKN \le K (there are never more kettles than people)
  • Each amount is an integer between 00 and 23112^{31}-1, inclusive.

Output

Print the largest amount (in ml) per person that can be given equally to all KK people. If it is impossible to give even 1 ml to each of the KK people, print 0.

Hint

In the second example, pouring 205 ml per person gives 2, 2, 3, and 4 servings from the four kettles, 11 servings in total. Pouring 206 ml gives only 2, 2, 3, and 3 servings, which is 10, so the amount has to be a little smaller.