#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <iterator>
#include <vector>

int main()
{
    int n = 0;
    long long k = 0;
    std::cin >> n >> k;
    
    std::deque<long long> minusDeq;
    std::deque<long long> plusDeq;
    
    for(int i = 0; i < n; ++i)
    {
        long long a = 0;
        std::cin >> a;
        if(a > 0)
        {
            plusDeq.emplace_back(a);
        }
        else if(a < 0)
        {
            minusDeq.emplace_back(a);
        }
    }
    
    std::vector<long long> minusVec;
    minusVec.reserve(minusDeq.size());
    std::copy(minusDeq.begin(), minusDeq.end(), std::back_inserter(minusVec));
    std::sort(minusVec.begin(), minusVec.end());
    
    std::vector<long long> plusVec;
    plusVec.reserve(plusDeq.size());
    std::copy(plusDeq.begin(), plusDeq.end(), std::back_inserter(plusVec));
    std::sort(plusVec.begin(), plusVec.end());
    
    const long long zeroSize = n - minusVec.size() - plusVec.size();
    const long long minusCount = minusVec.size() * plusVec.size();
    const long long zeroCount = zeroSize * (zeroSize - 1) / 2 + zeroSize * (minusVec.size() + plusVec.size());

    if(minusCount >= k)
    {
        long long left = -1e18 - 1;
        long long right = -1;
        while(right - left > 1)
        {
            const long long mid = (left + right) / 2;
            long long count = 0;
            for(long long plusNum : plusVec)
            {
                long long border = mid / plusNum;
                if(mid % plusNum != 0)
                {
                    --border;
                }
                count += std::distance(minusVec.begin(), std::upper_bound(minusVec.begin(), minusVec.end(), border));
            }
            
            if(count >= k)
            {
                right = mid;
            }
            else
            {
                left = mid;
            }
        }
        std::cout << right << std::endl;
    }
    else if(minusCount + zeroCount >= k)
    {
        std::cout << 0 << std::endl;
    }
    else
    {
        k -= (minusCount + zeroCount);      
        std::for_each(minusVec.begin(), minusVec.end(), [](long long& i){ i = std::abs(i);});
        std::sort(minusVec.begin(), minusVec.end());

        long long left = -1;
        long long right = 1e18;
        while(right - left > 1)
        {
            const long long mid = (left + right) / 2;
            long long sum = 0;
            for(int i = 0; i < static_cast<int>(plusVec.size()); ++i)
            {
                const int dist = std::distance(plusVec.begin(), std::upper_bound(plusVec.begin(), plusVec.end(), mid / plusVec.at(i)));
                sum += dist;
                if(i < dist)
                {
                    // 自分自身は含めない
                    sum -= 1;
                }
            }

            for(int i = 0; i < static_cast<int>(minusVec.size()); ++i)
            {
                const int dist = std::distance(minusVec.begin(), std::upper_bound(minusVec.begin(), minusVec.end(), mid / minusVec.at(i)));
                sum += dist;
                if(i < dist)
                {
                    // 自分自身は含めない
                    sum -= 1;
                }
            }          
            sum /= 2;
            
            if(sum >= k)
            {
                right = mid;
            }
            else
            {
                left = mid;
            }
        }
        std::cout << right << std::endl;        
    }
}

Measured memory_bytes: 3072