output_description: Print the minimum possible number of total banknotes used by you and the
  clerk.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: """
  ika tako
  X個中のK番目を求めたいが、Xが巨大すぎて全部を実際に計算してられない.
  問題は「答えがaだとして、積がa以下となるペアがK個以上できるか？」を
  チェックする二分探索で求められることがある。
  まず問題を仮にAiが全て正として単純化し「積がM以下となるペアが
  K個以上できるか」を判定する.
  """
  
  from bisect import bisect
  
  
  def check_neg(m, k, pos, neg, len_pos):
      less = 0  # m 未満になるペア数
      j = 0
      for a in neg:
          d = m // a
          while j < len_pos and pos[j] <= d:
              j += 1
          if len_pos == j:
              break
          less += len_pos - j
      return less < k
  
  
  def check_pos(m, k, pos, neg, len_pos, len_neg):
      less_eq = 0  # m 以下になるペア数
      j = 0
      for i in range(len_pos - 1, -1, -1):
          a = pos[i]
          d = m // a
          while j < len_pos and pos[j] <= d:
              j += 1
          if j == len_pos:
              less_eq += len_pos * (i + 1)
              break
          less_eq += j
  
      j = 0
      for i in range(len_neg - 1, -1, -1):
          a = neg[i]
          d = m // a
          while j < len_neg and neg[j] <= d:
              j += 1
          if j == len_neg:
              less_eq += len_neg * (i + 1)
              break
          less_eq += j
  
      m_sqrt = int(m**0.5)
      less_eq -= bisect(pos, m_sqrt)
      less_eq -= bisect(neg, m_sqrt)
  
      less_eq //= 2
  
      return less_eq < k
  
  
  def solve(n, k, aaa):
      pos = [a for a in aaa if a > 0]
      neg = [a for a in aaa if a < 0]
      len_pos = len(pos)
      len_neg = len(neg)
      neg_mul = len_pos * len_neg
      pos_mul = len_pos * (len_pos - 1) // 2 + len_neg * (len_neg - 1) // 2
      if neg_mul >= k:
          l = -(10**18)
          r = 0
          while l + 1 < r:
              m = (l + r) // 2
              if check_neg(m, k, pos, neg, len_pos):
                  l = m
              else:
                  r = m
          return l
      elif n * (n - 1) // 2 - pos_mul >= k:
          return 0
      else:
          k -= n * (n - 1) // 2 - pos_mul
          l = 0
          r = 10**18
          neg = [-a for a in neg]
          neg.reverse()
          while l + 1 < r:
              m = (l + r) // 2
              if check_pos(m, k, pos, neg, len_pos, len_neg):
                  l = m
              else:
                  r = m
          return r
  
  
  n, k = map(int, input().split())
  aaa = list(map(int, input().split()))
  aaa.sort()
  print(solve(n, k, aaa))
  
problem_description: Statement
  
  In the Kingdom of AtCoder, only banknotes are used as currency. There are
  10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \dots,
  10^{(10^{100})}. You have come shopping at a mall and are now buying a
  takoyaki machine with a value of N. _(Takoyaki is the name of a Japanese
  snack.)_
  
  To make the payment, you will choose some amount of money which is at least N
  and give it to the clerk. Then, the clerk gives you back the change, which is
  the amount of money you give minus N.
  
  What will be the minimum possible number of total banknotes used by you and
  the clerk, when both choose the combination of banknotes to minimize this
  count?
  
  Assume that you have sufficient numbers of banknotes, and so does the clerk.
samples: [{"input": "36", "output": "8\n    \n\nIf you give four banknotes of value 10 each, and the clerk gives you back four\nbanknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the\nanswer is 8.\n\n* * *"}, {"input": "91", "output": "3\n    \n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one\nbanknote of value 10, a total of three banknotes are used.\n\n* * *"}, {"input": "314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170", "output": "243"}]