n,r=[int(x) for x in raw_input().split()]
l=[int(x) for x in raw_input().split()]
l1=reduce(lambda x,t: x+t ,l,0)

x=2**n+0.0
print("{0:0.6f} ".format((l1+0.0)/(x)))
for s in range(0,r):
      y,z=[int(y) for y in raw_input().split()]
      l1-=l[y]
      l[y]=z
      l1+=z
      print("{0:0.6f} ".format((l1+0.0)/(x)))






      
