P = int(input())
N = list(map(int,input().split()))
N.reverse()
#print(N)
s = sum(N)/P
minfr=9999
ans = 0
print(s)
for i ,n in enumerate(N):
    minfr = min(minfr,abs(n-s))
    print(minfr,i,n)
    if minfr == abs(n-s):
        ans = i
    # TODO: write code...
print(abs(ans-(P-1)))