Under construction

Still being built. Things may change

Statistics

Time limit1.5sMemory limit256 MB

Summary
Pick the fewest courses whose units sum to exactly V, then find the minimum average, median, highest repeat count, and max-min range over those schedules.
Level

Medium6 of 10

Topics
Dynamic programming, Sorting, Implementation
Solved
No attempts yet

Statistics

You are choosing courses for your last semester of university. There are NN courses available, numbered from 11 through NN. Course ii is worth viv_i units, and you need at least VV units to graduate. Because you want more time to train for ACM ICPC, you want to choose a subset of courses that gives exactly VV units. You also want to choose the fewest courses possible, so you spend less time walking around campus. Such a subset is called a good schedule.

You want to pick among all good schedules with the help of some statistics. For each good schedule, view it as a list of the units of its courses and calculate the following values.

  • aa: the average value.
  • bb: the median value. If the list has an even length, use the smaller of the two middle values.
  • cc: the maximum number of times a single value appears.
  • dd: the difference between the maximum value and the minimum value.

For each of aa, bb, cc, and dd, find its minimum over all good schedules.

Input

The first line contains two integers, NN and VV: the number of courses and the number of units you need to graduate (1≤N,V≤50001 \leq N, V \leq 5000).

The next line contains NN integers v1,v2,…,vNv_1, v_2, \ldots, v_N, the number of units in each course (1≤vi≤V1 \leq v_i \leq V).

Output

Print four space-separated real numbers: the minimum aa, bb, cc, and dd over all good schedules, in that order. Your answer must have an absolute or relative error less than 10−610^{-6}. If there are no good schedules, print a single integer −1-1 instead.

Examples2

  1. Example 1

    Input
    6 15
    6 1 13 5 4 1
    
    Expected output
    5.000000000 1 1 2
    
  2. Example 2

    Input
    3 7
    3 1 2
    
    Expected output
    -1