program ATMASS 20 read(*,*)n s=0 ps=0 do 10 i=1,n read(*,*)w,p s=s + w*p ps=ps+p 10 continue s=s/ps write(*,*)ps,s goto 20 end