| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1.5 초 | 256 MB | 9 | 2 | 2 | 66.667% |
It is time to select courses for your last semester of university. There are $N$ courses available, numbered from 1ドル$ through $N$. Course $i$ is worth $v_i$ units, and you need at least $V$ units to graduate. Because you want more time to train for ACM ICPC, you want to choose a subset of courses that gives exactly $V$ units. Also, you want to choose the least number of courses possible to minimize the amount of time spent walking around campus. You call such a subset a good schedule.
You are having trouble choosing among all possible good schedules, so you turn to statistics for help. For each good schedule, viewing it as a list of the units of its courses, you calculate:
For each of $a,ドル $b,ドル $c,ドル and $d,ドル find its minimum over all good schedules.
The first line contains two integers, $N$ and $V$: the number of courses and the number of units you need to graduate (1ドル \leq N, V \leq 5000$).
The next line contains $N$ integers $v_1, v_2, \ldots, v_N,ドル the number of units in each of the available courses (1ドル \leq v_i \leq V$).
Print out four space-separated real numbers: the minimum $a,ドル $b,ドル $c,ドル and $d$ over all good schedules, in that order. If there are no good schedules, print a single integer $-1$ instead. Your answer must have an absolute or relative error less than 10ドル^{-6}$.
6 15 6 1 13 5 4 1
5.000000000 1 1 2
3 7 3 1 2
-1