# Arup Guha
# 3/6/2021
# Solution to 2020 SER Problem: Rating Problems

line = input("").split()
n = int(line[0])
k = int(line[1])

# Get cur total
tot = 0
for i in range(k):
    val = int(input(""))
    tot += val

# Calculate min and max sums.
mintot = tot - 3*(n-k)
maxtot = tot + 3*(n-k)

print(mintot/n, maxtot/n)
