Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Scholarship

By subeen · Limits 2s, 512 MB

Your school is going to start a new scholarship program. To apply for this scholarship you have to write an application and mention how much scholarship do you need. A lot of students applied for this scholarship and a few of them were selected. Just before issuing the scholarship, the accountant came to know that, the total budget allotment for scholarship has been reduced. So it’s not possible to offer the selected candidates their requested amount. Now if they offer some students less than their requested amount they will become sad. But the Head master wants to minimize the number of sad students. Your task is to write a program for the headmaster. The program will find such a number, that no students will be given more than that amount of money.

Input

First line of input will have at most 100100 integers. These number represents the amount of money requested by each students. Second line will have the new allotted budget. Every number will be >= 0 and < 2312^{31}.

Output

Output will have a number, which is the maximum amount allotted budget for a single student. You have to print two digits after the decimal place.

Sample

InputOutput
100 2 50 120 1000
190
47.00

Note - for sample input. If we allot at most Tk. 4747 for each students, then total expense would be, 47+2+47+47+47=19047 + 2 + 47 + 47 + 47 = 190. The student who applied for Tk. 22, he will be given Tk. 22 only, no more than that.

Discussion

Toph uses cookies. By continuing you agree to our Cookie Policy.