      MODULE intQsortMod
! 整数型のクイックソート
! precisionで整数の精度を定める．
! インデックスの小さいほうが値も小さい(昇順)．

! 参考
! https://t.doujin-constant.net/post/143374686394/fortranをより使いこなしたquick-sort

      implicit none
      integer,parameter,private :: precision = 16
      
      interface qSort
        module procedure :: intQsort
      end interface
      
      contains
      pure recursive function intQsort( a ) result( r )
        implicit none
        integer(precision), intent(in) :: a(:)
        integer(precision) :: r( size(a) )
        integer(precision) :: sample(3), len, i,j
        
        len = size( a(:) )
        if( len<=1 )then
          r = a
        else
          !select pivot
          sample(1:3) = [a(1), a(len/2), a(len)]
          do i = 1,2
            do j = 2,3
              if( sample(i)>sample(j) )then
                len = sample(i) !len is buffer
                sample(i) = sample(j)
                sample(j) = len
              end if
            end do
          end do
          
          r = [ qSort( pack(a(:), a(:)< sample(2) ) ), &
                       pack(a(:), a(:)==sample(2) )  , &
                qSort( pack(a(:), a(:)> sample(2) ) ) ]
        end if
      end function intQsort
      END MODULE intQsortMod

      PROGRAM Alchemist
      use intQsortMod
      IMPLICIT NONE
      integer(16) :: n,ans
      integer(16),allocatable :: v(:)
      integer(16) :: i
      real(16),allocatable :: reV(:)
      
      read*,n
      allocate( v(n),rev(n) )
      read*,v(1:n)
      
      v = Qsort( v )
      !print*,v
      
      reV = real( v )
      
      do i = 2,n
        reV(i) = (reV(i)+reV(i-1)) / 2_16
      end do
      
      print*,reV(n)
      
      
      END PROGRAM