n, k = map(int, input().split()) s = 0 for _ in range(k): s += int(input()) print(f"{(s - (n-k)*3) / n} {(s + (n-k)*3) / n}")