// SmartCoder
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>  // Including tree_order_statistics_node_update

using namespace __gnu_pbds;
using namespace std;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define minei(x) min_element(x.begin(), x.end()) - (x).begin()
#define maxei(x) max_element(x.begin(), x.end()) - (x).begin()
#define LSOne(S) (S & (-S))

#define uns(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define acusum(x) accumulate(x.begin(), x.end(), 0)
#define acumul(x) accumulate(x.begin(), x.end(), 1, multiplies<int>());
#define bits(x) __builtin_popcount(x)
#define oo INT_MAX
#define inf 1000000000
#define MAXN 1000007
#define MOD 1000000007

const double pi = acos(-1.0);
const double eps = 1e-11;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
vector<ll> pos, neg, zero;
ll totalZeros = 0, totalNeg = 0;
ll n, k;
void calculateTotals() {
    ll posSize = sz(pos);
    ll negSize = sz(neg);
    ll zeroSize = sz(zero);

    totalNeg = negSize * posSize;
    totalZeros = (zeroSize * posSize) + (zeroSize * negSize) + ((zeroSize * (zeroSize - 1)) / 2);
    //totalZeros = (zeroSize * (zeroSize - 1) / 2) + zeroSize * (n - zeroSize);
}
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;
}
ll calcPos(ll md) {
    ll cnt = 0;
    int last = sz(neg) - 1;
    int indx = 0;
    while (indx < last) {
        if (neg[indx] * neg[last] <= md) {
            cnt += (last - indx);
            indx++;
        } else {
            last--;
        }
    }
    indx = 0;
    last = sz(pos) - 1;
    while (indx < last) {
        if (pos[indx] * pos[last] <= md) {
            cnt += (last - indx);
            indx++;
        } else {
            last--;
        }
    }
    return cnt;
}
int main() {
    cin >> n >> k;
    ll nm, res = 0;

    for (int i = 0; i < n; i++) {
        cin >> nm;
        if (nm > 0)
            pos.pb(nm);
        else if (nm < 0)
            neg.pb(nm);
        else
            zero.pb(nm);
    }
    calculateTotals();
    if (k <= totalNeg) {
        //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;
                res = md;
            }
        }

    } else if (k <= totalNeg + totalZeros) {
        //zero
        res = 0;
    } else {
        //postive
        k -= (totalNeg + totalZeros);
        sort(all(neg));
        reverse(all(neg));
        sort(all(pos));
        ll l = -1e18, r = 1e18, md;
        while (l <= r) {
            md = (l + r) / 2ll;
            ll tot = calcPos(md);
            if (tot < k) {
                l = md + 1;
            } else {
                r = md - 1;
                res = md;
            }
        }
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 2548