
function quickSort(arr, leftPos, rightPos, arrLength) {
  var initialLeftPos = leftPos;
  var initialRightPos = rightPos;
  var direction = true;
  var pivot = rightPos;
  while ((leftPos - rightPos) < 0) {
    if (direction) {
      if (arr[pivot] < arr[leftPos]) {
        quickSort.swap(arr, pivot, leftPos);
        pivot = leftPos;
        rightPos--;
        direction = !direction;
      } else
        leftPos++;
    } else {
      if (arr[pivot] <= arr[rightPos]) {
        rightPos--;
      } else {
        quickSort.swap(arr, pivot, rightPos);
        leftPos++;
        pivot = rightPos;
        direction = !direction;
      }
    }
  }
  if (pivot - 1 > initialLeftPos) {
    quickSort(arr, initialLeftPos, pivot - 1, arrLength);
  }
  if (pivot + 1 < initialRightPos) {
    quickSort(arr, pivot + 1, initialRightPos, arrLength);
  }
}
quickSort.swap = (arr, el1, el2) => {
  var swapedElem = arr[el1];
  arr[el1] = arr[el2];
  arr[el2] = swapedElem;
}


function Main(arg)
{
  var N = arg.split("\n")[0].split(" ")[0] - 0;
  var K = arg.split("\n")[0].split(" ")[1] - 0;
  var A = arg.split("\n")[1].split(" ").map(Number);

  var prod = [];
  for (var i = 0; i < N-1; i++){
    for (var j = i + 1; j < N; j++){
      prod.push((A[i]*A[j]));
    }
  }
  var len = (N * (N - 1)) / 2;
  quickSort(prod, 0, len-1, len);

  console.log(prod[K-1]);
  return;
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));