object Main extends scala.App {
    import java.util
    import scala.collection._
    import scala.collection.mutable.ListBuffer
    import scala.math._

    val sc = new java.util.Scanner(System.in)
    val N, K = sc.nextInt()
    val As = List.fill(N)(sc.nextInt().toLong)

    val gen = for (i <- As.indices; j <- As.indices if i < j) yield (i, j)
    print(gen
            .map(t => As(t._1) * As(t._2))
            .sorted
            .drop(K - 1)
            .head
    )
}