Survey
시간 제한1초메모리 제한512 MB
m달러를 n개의 몫으로 나누고 각 구성원의 임계값이 주어질 때, 무작위로 받은 몫이 임계값 이상인 구성원 수의 기댓값을 최대로 만드는 분배를 설계한다.
문제
You are doing a survey and want to find respondents in your social group. Your social group has size , and you have a budget of dollars. You need to divide the dollars into shares. Each group member will get one of the shares uniformly at random. Note that the money contained in each share can be any non-negative real number.
Luckily, you know the reward threshold of each group member. If a person has a reward threshold of , they will participate in the survey if and only if they have received a share of at least dollars, otherwise they will just accept the payment and not participate in the survey. Since you want as many group members as possible to participate in the survey, you need to design a plan to divide the dollars into shares in order to maximize the expected number of members who will participate in the survey.
입력
The first line contains two integers () and (), denoting the number of group members and your budget.
The next line contains integers (), denoting the reward threshold of each member.
출력
Print a single real number: the maximum expected number of members to participate in the survey.
The answer will be considered correct if the absolute or relative error between the output and the jury's answer is at most .