n,r = map(int, raw_input().split())
ls = map(int, raw_input().split())
sm=sum(ls)
nls=2**n
print float(sm)/nls
for i in range(r):
    a,b = map(int, raw_input().split())
    sm+=b-ls[a]
    ls[a]=b
    print float(sm)/nls