#include <bits/stdc++.h>

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

const LL inf = 1LL<<60;
LL n,k; vector<LL> neg,zero,pos, A;

LL count(const LL mid)
{
    LL cnt = 0;
    if (mid < 0) {
        for (int i = 0; i < neg.size(); i++) {
            /*
             * ceil function for negative number (avoid double
             * representation gap), WA for long time.
             */
            /* const LL  b = ceil(1.0*mid/neg[i]); /\* WA!! *\/ */
            const LL  b = (mid+neg[i]+1)/neg[i];
            const int j = lower_bound(ALL(pos),b) - pos.begin();
            cnt += pos.size() - j;
        }
    }
    else {
        /* 0 */
        cnt += 1LL * neg.size() * pos.size();
        cnt += 1LL * neg.size() * zero.size();
        cnt += 1LL * pos.size() * zero.size();
        cnt += 1LL * zero.size() * (zero.size()-1)/2;
        if (mid > 0) {
            for (int i = 0; i < neg.size(); i++) {
                const LL  b = mid/neg[i];
                const int j = lower_bound(
                    neg.begin()+i+1, neg.end(), b) - neg.begin();
                cnt += neg.size() - j;
            }
            for (int i = 0; i < pos.size(); i++) {
                const LL  b = mid/pos[i];
                const int j = upper_bound(
                    pos.begin()+i+1, pos.end(), b) - pos.begin();
                cnt += j - (i+1);
            }
        }
    }
    return cnt;
}

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    while (cin >> n >> k) {
        neg.clear(); zero.clear(); pos.clear(); A.clear();
        FOR(i,0,n) {
            LL a; cin >> a;
            A.push_back(a);
            if (a <  0) neg. push_back(a);
            if (a == 0) zero.push_back(a);
            if (a >  0) pos. push_back(a);
        }
        sort(ALL(neg)); sort(ALL(pos)); sort(ALL(A));
        LL lo = -inf, hi = inf;
        while (lo < hi) {
            const LL mid = (hi+lo)>>1;
            if (count(mid) >= k)
                hi = mid;
            else
                lo = mid + 1;
        }
        /* find smallest A[i]*A[j] >= lo, (lo may not be a A[i]*A[j]) */
        LL ans = lo, res = inf;
        if (ans <= 0 && zero.size())
            res = 0;
        FOR(i,0,n) if (A[i]) {
            const LL b[] = { ans/A[i], ans/A[i]+1 };
            FOR(ii,0,SZ(b)) {
                const int d = 3; /* arbitrary small range */
                const int x = lower_bound(ALL(A),b[ii]) - A.begin();
                const int y = upper_bound(ALL(A),b[ii]) - A.begin();
                FOR(j,x-d,x+d) if (0 <= j && j < n && j != i) {
                    const LL val = A[i]*A[j];
                    if (val >= ans)
                        res = min(res,val);
                }
                FOR(j,y-d,y+d) if (0 <= j && j < n && j != i) {
                    const LL val = A[i]*A[j];
                    if (val >= ans)
                        res = min(res,val);
                }
            }
        }
        ans = res;
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 4592