This page is still under construction.

Parts of this page are still being built. What you see may change.

Rating Problems

Interview

Time limit1sMemory limit512 MB

Summary
Given some judges' ratings, find the minimum and maximum possible average once the remaining judges submit ratings between -3 and 3.
Level

Easy2 of 10

Topics
Math, Implementation, Greedy
Solved
No attempts yet

Problem

Your judges are preparing a problem set, and they are trying to evaluate a problem for inclusion in the set. Each judge rates the problem with an integer between −3-3 and 33, where:

  • 33 means: I really like this problem!
  • −3-3 means: I really don't like this problem!
  • 00 means: Meh. I don't care if we use this problem or not.

The overall rating of the problem is the average of all of the judges' ratings, that is, the sum of the ratings divided by the number of judges providing a rating.

Some judges have already rated the problem. Compute the minimum and maximum possible overall rating that the problem can end up with after the other judges submit their ratings.

Input

The first line of input contains two integers nn (1≤n≤101 \le n \le 10) and kk (0≤k≤n0 \le k \le n), where nn is the total number of judges, and kk is the number of judges who have already rated the problem.

Each of the next kk lines contains a single integer rr (−3≤r≤3-3 \le r \le 3). These are the ratings of the kk judges that have already rated the problem.

Output

Output two space-separated floating point numbers on a single line, which are the minimum and maximum overall rating the problem could achieve after the remaining judges rate the problem, minimum first. These values must be accurate to an absolute or relative error of 10−410^{-4}.

Examples2

  1. Example 1

    Input
    5 2
    1
    2
    
    Expected output
    -1.2 2.4
    
  2. Example 2

    Input
    4 4
    -3
    -3
    -2
    -3
    
    Expected output
    -2.75 -2.75