function Main (input) {
  input = input.split("\n").map(inp => inp.split(" ").map(inp2 => parseInt(inp2, 10)));
  const N = input[0][0];
  const K = input[0][1];
  var A = input[1];
  var seki = [];

  for (var i = 0; i < N; i++) {
    for (var j = i + 1; j < N; j++) {
      seki.push(A[i] * A[j]);
    }
  }
  seki.sort((a, b) => b < a);
  console.log(seki[K - 1]);
}

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