#include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;

namespace Math {
// Generic modular integer.
    template<int MOD, typename IntType = int>
    struct GModint {
        IntType val;

        GModint() : val(0) {}

        GModint(int v, bool safe = false) { val = safe ? v : ((v % MOD) + MOD) % MOD; }

        GModint(ll v, bool safe = false) { val = safe ? v : ((v % MOD) + MOD) % MOD; }

        explicit operator bool() const { return val != 0; }

        const bool operator==(const GModint &g) const { return val == g.val; }

        const bool operator!=(const GModint &g) const { return val != g.val; }

        const GModint operator+=(const GModint &g) { return *this = *this + g; }

        const GModint operator-=(const GModint &g) { return *this = *this - g; }

        const GModint operator*=(const GModint &g) { return *this = *this * g; }

        const GModint operator/=(const GModint &g) { return *this = *this / g; }

        const GModint operator^=(const GModint &g) { return *this = *this ^ g; }

        const GModint operator-() const { return GModint(val == 0 ? 0 : MOD - val, true); }

        const GModint operator+(const GModint &g) const {
            ll newval = val + g.val;
            if (newval >= MOD)
                newval -= MOD;
            return GModint(newval, true);
        }

        const GModint operator-(const GModint &g) const { return *this + (-g); }

        const GModint operator*(const GModint &g) const { return GModint(1ll * val * g.val); }

        const GModint operator/(const GModint &g) const { return *this * g.inv(); }

        template<class T>
        const GModint operator^(const T t) const { return GModint(modpow(val, t, MOD)); }

        const GModint inv() const { return GModint(modinv(val, MOD)); }
    };

    using Modint = GModint<1000000007>;
}

int n;
ll k;
vector<ll> neglist, poslist, zerolist;
ll count_neg, count_zero, count_pos;

ll count_lt(ll x) {
    if (x < 0) {
        ll sum = 0;

        // count numbers > abs(x)

        for (int h : neglist) {
            auto it = upper_bound(poslist.begin(), poslist.end(), -x / h);
            sum += poslist.end() - it;
        }

        return sum;
    } else if (x == 0) {
        return count_neg;
    } else if (x > 0) {
        ll sum = 0;

        for (int h : neglist) {
            auto it = upper_bound(neglist.begin(), neglist.end(), x / h - (x % h == 0 ? 1 : 0));
            sum += it - neglist.begin();
        }
        for (int h : poslist) {
            auto it = upper_bound(poslist.begin(), poslist.end(), x / h - (x % h == 0 ? 1 : 0));
            sum += it - poslist.begin();
        }

        ll sqrtx = sqrt(x);
        while (sqrtx * sqrtx >= x) sqrtx--;
        while ((sqrtx + 1) * (sqrtx + 1) < x) sqrtx++;

        {
            auto it = upper_bound(neglist.begin(), neglist.end(), sqrtx);
            sum -= it - neglist.begin();
        }
        {
            auto it = upper_bound(poslist.begin(), poslist.end(), sqrtx);
            sum -= it - poslist.begin();
        }

        return count_neg + count_zero + (sum / 2);
    }
}

ll count_lte(ll x) {
    return count_lt(x + 1);
}

void bs_pos() {
    ll first = ll(-2e18), last = ll(2e18);

    ll it;
    ll count, step;

    count = last - first;

    while (count > 0) {
        it = first;
        step = count / 2;
        it += step;
        if (count_lte(it) < k) {
            first = ++it;
            count -= step + 1;
        } else {
            count = step;
        }
    }

    cout << first << endl;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n;
    cin >> k;
    for (int i = 0; i < n; i++) {
        ll t; cin >> t;
        if (t > 0) poslist.push_back(t);
        if (t < 0) neglist.push_back(t);
        if (t == 0) zerolist.push_back(t);
    }

    for (auto &x : neglist) x = -x;

    sort(poslist.begin(), poslist.end());
    sort(neglist.begin(), neglist.end());

    count_neg = 1ll * neglist.size() * poslist.size();

    count_zero += 1ll * zerolist.size() * (zerolist.size() - 1) / 2;
    count_zero += 1ll * zerolist.size() * poslist.size();
    count_zero += 1ll * zerolist.size() * neglist.size();

    count_pos += 1ll * poslist.size() * (poslist.size() - 1) / 2;
    count_pos += 1ll * neglist.size() * (neglist.size() - 1) / 2;

    bs_pos();
}

Measured memory_bytes: 2548