program name
    implicit none
    integer(4):: n,t,i,j,nmin,nmax
    integer(4),allocatable:: a(:), p(:)

    read*, n,t
    allocate(a(n),p(n))
    read*, a(:)
    nmin = maxval(a)
    nmax=0
    do i=1,n
        nmin = min(nmin,a(i))
        p(i) = a(i)-nmin
        nmax = max(nmax,p(i))
    end do

    print*, sum(p,mask=p==nmax)/nmax
end program name