#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(), (c).end()
const int N = 2e5 + 87;
ll n, k, a[N];
ll c0, cn, cp;
ll solvene() {
    vector<ll> x(a, a + cn);
    vector<ll> y(a + n - cp, a + n);
    ll lo = x[0] * y.back();
    ll hi = x.back() * y[0];
    //cerr << "lo hi "<< lo << ' '<< hi << endl;
    reverse(x.begin(), x.end());
    reverse(y.begin(), y.end());
    //cerr << "x= "; for (ll t : x) cerr << t << ' '; cerr << endl;
    //cerr << "y= "; for (ll t : y) cerr << t << ' '; cerr << endl;
    while (lo <= hi) {
        ll mi = lo + (hi - lo) / 2;
        ll c = 0;
        for (ll i = 0, j = 0; i < x.size(); ++i) {
            for (; j < y.size() && x[i] * y[j] <= mi; ++j)
                ;
            //cerr << "i,j,x[i] " << i << ' ' << j << ' ' << x[i]<< endl;
            c += j;
        }
        //cerr << "mi, c "<< mi << ' ' << c << endl;
        if (c < k)
            lo = mi + 1;
        else
            hi = mi - 1;
    }
    return lo;
}
ll solvenp(ll k) {
    vector<ll> x(a, a + cn);
    reverse(x.begin(), x.end());
    vector<ll> y(a + n - cp, a + n);
    ll lo = LLONG_MAX;
    ll hi = LLONG_MIN;
    if (x.size() >= 2) {
        lo = min(lo, x[0] * x[1]);
        hi = max(hi, x[cn - 1] * x[cn - 2]);
    }
    if (y.size() >= 2) {
        lo = min(lo, y[0] * y[1]);
        hi = max(hi, y[cp - 1] * y[cp - 2]);
    }
    while (lo <= hi) {
        ll mi = lo + (hi - lo) / 2;
        ll c = 0;
        for (ll i = cp - 1, j = 0; i >= 0; --i) {
            for (; j < i && y[i] * y[j] <= mi; ++j)
                ;
            c += min(j, i);
        }
        for (ll i = cn - 1, j = 0; i >= 0; --i) {
            for (; j < i && x[i] * x[j] <= mi; ++j)
                ;
            c += min(j, i);
        }
        //cerr << "mi, c " << mi << ' ' << c << endl;
        if (c < k)
            lo = mi + 1;
        else
            hi = mi - 1;
    }
    return lo;
}
vector<ll> pos, neg, zero;
ll calcNeg(ll md) {
    ll cnt = 0;
    int last = sz(pos) - 1;
    int indx = 0;
    while (indx < sz(neg) && last >= 0) {
        if (neg[indx] * pos[last] <= md) {
            cnt += (last + 1);
            indx++;
        } else {
            last--;
        }
    }
    return cnt;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        if (a[i] == 0)
            ++c0, zero.pb(a[i]);
        else if (a[i] > 0)
            ++cp, pos.pb(a[i]);
        else
            ++cn, neg.pb(a[i]);
    }
    sort(a, a + n);
    ll ne = cn * cp;
    ll n0 = c0 * (c0 - 1) / 2 + c0 * (n - c0);
    ll np = cp * (cp - 1) / 2 + cn * (cn - 1) / 2;
    ll ans;
    if (k <= ne) {
        //negative
        sort(all(neg));
        sort(all(pos));
        reverse(all(pos));
        ll l = -1e18, r = 1e18, md;
        while (l <= r) {
            md = (l + r) / 2ll;
            ll tot = calcNeg(md);
            if (tot < k) {
                l = md + 1;
            } else {
                r = md - 1;
                ans = md;
            }
        }
    } else if (k <= ne + n0) {
        ans = 0;
    } else {
        ans = solvenp(k - ne - n0);
    }
    cout << ans << "\n";
}

Measured memory_bytes: 4976