#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep2(i,i0,n) for(int i=i0;i<n;++i)

int main()
{
    ll n, k;
    cin >> n >> k;
    vector<ll> a[2]; // [0]:+ [1]:-
    ll zero_cnt = 0;
    rep(i,n) {
        ll ai;
        cin >> ai;
        if (ai == 0) ++zero_cnt;
        else if (ai > 0) a[0].push_back(ai);
        else a[1].push_back(ai);
    }
    ll m[2] = {(ll)a[0].size(), (ll)a[1].size()};
    ll nega_p_cnt = m[0]*m[1];
    ll zero_p_cnt = zero_cnt*(n-zero_cnt) + zero_cnt*(zero_cnt-1)/2;

    if (k > nega_p_cnt && k <= nega_p_cnt + zero_p_cnt) {
        cout << 0 << endl;
        return 0;
    }

    sort(a[0].begin(), a[0].end());
    sort(a[1].begin(), a[1].end(), greater<ll>());

    bool negative = (k <= nega_p_cnt);
    ll ok = -1e18-7, ng = +1e18+7;

    if (negative) {
        ok = a[0].front() * a[1].front();
        ng = a[0].back() * a[1].back() - 1;
    }
    else {
        if (m[0] > 1) {
            ok = max(ok, a[0][m[0]-1] * a[0][m[0]-2]);
            ng = min(ng, a[0][0] * a[0][1] - 1);
        }
        if (m[1] > 1) {
            ok = max(ok, a[1][m[1]-1] * a[1][m[1]-2]);
            ng = min(ng, a[1][0] * a[1][1] - 1);
        }
    }

    // printf("ok=%lld ng=%lld negative=%d nega_p_cnt=%lld zero_p_cnt=%lld \n", 
    //         ok, ng, (int)negative, nega_p_cnt, zero_p_cnt);

    auto is_ok = [&](ll mid){
        ll sum = 0;
        if (negative) {            
            rep(i, m[1]) {
                ll ok_ = m[0];
                ll ng_ = -1;
                auto is_ok_ = [&](ll x){
                    return a[0][x] * a[1][i] <= mid;
                };
                while(abs(ng_-ok_)>1) {
                    ll x = (ok_+ng_)/2;
                    if(is_ok_(x)) ok_ = x;
                    else ng_ = x;
                }
                sum += m[0]-ok_;
            }
            // printf("mid=%lld sum=%lld \n", mid, sum);
            return sum >= k;
        }
        else {
            rep(i, m[0]) {
                ll ok_ = m[0];
                ll ng_ = -1;
                auto is_ok_ = [&](ll x){
                    return a[0][x] * a[0][i] > mid;
                };
                while(abs(ng_-ok_)>1) {
                    ll x = (ok_+ng_)/2;
                    if(is_ok_(x)) ok_ = x;
                    else ng_ = x;
                }
                sum += ok_;
                if(a[0][i] * a[0][i] <= mid) --sum;
                // printf("mid=%lld i=%d ok_=%lld ng_=%lld sum=%lld \n", mid,i,ok_,ng_,sum);
            }            
            rep(i, m[1]) {
                ll ok_ = m[1];
                ll ng_ = -1;
                auto is_ok_ = [&](ll x){
                    return a[1][x] * a[1][i] > mid;
                };
                while(abs(ng_-ok_)>1) {
                    ll x = (ok_+ng_)/2;
                    if(is_ok_(x)) ok_ = x;
                    else ng_ = x;
                }
                sum += ok_;
                if(a[1][i] * a[1][i] <= mid) --sum;
            }
            // printf("mid=%lld sum=%lld \n", mid, sum);
            return sum/2 + nega_p_cnt + zero_p_cnt >= k;
        }
    };

    while(abs(ok-ng) > 1) {
        ll mid = (ok+ng)/2;
        if(is_ok(mid)) ok = mid;
        else ng = mid;
    }

    cout << ok << endl;
    return 0;
}

Measured memory_bytes: 2420