program main
      implicit none
      integer(8), allocatable :: a(:)
      integer(8) :: n, j, i, k, mins, zero, plus, cnt, str
      integer(16), allocatable :: ms(:), ps(:)
      integer(16), allocatable :: mul(:)

      read *, n, k
      allocate( a(n) )
      read *, a

      mins = 0
      zero = 0
      plus = 0
      do i = 1, n
        if ( a(i) < 0 ) then
          mins = mins + 1
        else if ( a(i) == 0 ) then
          zero = zero + 1
        else if ( a(i) > 0 ) then
          plus = plus + 1
        end if
      end do
      
      allocate( ms(mins) )
      allocate( ps(plus) )
      mins = 0
      plus = 0
      do i = 1, n
        if ( a(i) < 0 ) then
          mins = mins + 1
          ms(mins) = a(i)
        else if ( a(i) == 0 ) then
        else if ( a(i) > 0 ) then
          plus = plus + 1
          ps(plus) = a(i)
        end if
      end do

      if ( k < mins*plus+1 ) then
        allocate( mul(mins*plus) )
        cnt = 0
        do i = 1, mins
          do j = 1, plus
            cnt = cnt + 1
            mul( cnt ) = ms(i) * ps(j)
          end do
        end do 
        str = 1
        call quicksort1(mul,str,cnt)
        print *, mul(k)
      else if ( (mins*plus <k).and.&
              (k< mins*plus+zero*(mins+plus)+zero*(zero-1)/2+1)) then
        print *, '0'
      else
        allocate( mul(mins*(mins-1)/2+plus*(plus-1)/2 ))
        cnt = 0
        do i = 1, mins
          do j = 1, mins
            if ( i == j ) cycle
            cnt = cnt + 1
            mul(cnt) = ms(i)*ms(j)
          end do
        end do
        do i = 1, plus
          do j = 1, plus
            if ( i == j ) cycle
            cnt = cnt + 1
            mul(cnt) = ps(i)*ps(j)
          end do
        end do
        str = 1
        call quicksort1(mul,str,cnt)
        print *, mul(k-(mins*plus+zero*(mins+plus)+zero*(zero-1)/2))
      end if

end program main
recursive subroutine quicksort1(a, first, last)
  implicit none
  integer(16),intent(inout)::a(*)
  integer(8),intent(in)::first,last
  !
  ! Original
  ! https://gist.github.com/t-nissie/479f0f16966925fa29ea
  !
  integer(8)::x,t
  integer(8)::i,j

  x = a((first+last)/2)
  i = first
  j = last
  do
     do while (a(i) < x)
        i=i+1
     end do
     do while (x < a(j))
        j=j-1
     end do
     if (i >= j) exit
     t = a(i)
     a(i) = a(j)
     a(j) = t
     i=i+1
     j=j-1
  end do
  if (first < i-1) call quicksort1(a, first, i-1)
  if (j+1 < last)  call quicksort1(a, j+1, last)

  return
end subroutine quicksort1
