from bisect import bisect_left, bisect_right

N, K = list(map(int, input().split()))

A = sorted(list(map(int, input().split())))

 

negative_end = bisect_left(A, 0)

positive_start = bisect_right(A, 0)

 

positive_cnt = N - positive_start

negative_cnt = negative_end

zero_cnt = N - (positive_cnt + negative_cnt)

 

negative_pairs_cnt = positive_cnt * negative_cnt

zero_pairs_cnt = zero_cnt * (positive_cnt + negative_cnt) + (zero_cnt * (zero_cnt - 1) // 2)



if K <= negative_pairs_cnt:

    ok, ng = 0, -10 ** 18

    while abs(ok - ng) > 1:

        X = (ok + ng) // 2

        or_higher_cnt, r = 0, positive_start

        for l in range(negative_end):

            while (r < N) and (A[l] * A[r] > X):

                r += 1

            or_higher_cnt += positive_cnt - (r - positive_start)

 

        if or_higher_cnt >= K:

            ok = X

        else:

            ng = X

 

    print(ok)



elif K <= negative_pairs_cnt + zero_pairs_cnt:

    print((0))



else:

    K -= (negative_pairs_cnt + zero_pairs_cnt)

    ok, ng = 10 ** 18, 0

    while abs(ok - ng) > 1:

        X = (ok + ng) // 2

        or_higher_cnt = 0

 

        r = N - 1

        for l in range(positive_start, N):

            while (r < N) and (A[l] * A[r] > X) and (l < r):

                r -= 1

            or_higher_cnt += max(0, r - l)

 

        l = 0

        for r in range(negative_end - 1, -1, -1):

            while (l < N) and (A[l] * A[r] > X) and (l < r):

                l += 1

 

            or_higher_cnt += max(0, r - l)

 

        if or_higher_cnt >= K:

            ok = X

        else:

            ng = X

 

    print(ok)
from bisect import bisect_left, bisect_right



n, k = list(map(int, input().split()))

a = sorted(list(map(int, input().split())))



pos_start = bisect_right(a, 0)

neg_end = bisect_left(a, 0)



pos_cnt = n - pos_start

neg_cnt = neg_end



pairs_cnt = n * (n - 1) // 2

pos_pairs_cnt = pos_cnt * (pos_cnt - 1) // 2 + neg_cnt * (neg_cnt - 1) // 2

neg_pairs_cnt = pos_cnt * neg_cnt



if k <= neg_pairs_cnt:

    high = 0

    low = -10 ** 18

    while abs(high - low) > 1:

        mid = (high + low) // 2

        cnt = 0

        r = pos_start

        for l in range(neg_end):

            while r < n and mid < a[r] * a[l]:

                r += 1

            cnt += pos_cnt - (r - pos_start)



        if cnt >= k:

            high = mid

        else:

            low = mid



    print(high)



elif pairs_cnt - pos_pairs_cnt < k:

    k -= (pairs_cnt - pos_pairs_cnt)

    high = 10 ** 18

    low = 0

    while abs(high - low) > 1:

        mid = (high + low) // 2

        cnt = 0

        r = n - 1

        for l in range(pos_start, n):

            while l < r and mid < a[r] * a[l]:

                r -= 1

            cnt += max(0, r - l)

        

        l = 0

        for r in range(neg_end-1, -1, -1):

            while l < r and mid < a[r] * a[l]:

                l += 1

            cnt += max(0, r - l)



        if cnt >= k:

            high = mid

        else:

            low = mid



    print(high)



else:

    print((0))
from bisect import bisect_left, bisect_right

N, K = list(map(int, input().split()))
A = sorted(list(map(int, input().split())))
negative_end = bisect_left(A, 0)
positive_start = bisect_right(A, 0)
positive_cnt = N - positive_start
negative_cnt = negative_end
zero_cnt = N - (positive_cnt + negative_cnt)
negative_pairs_cnt = positive_cnt * negative_cnt
zero_pairs_cnt = zero_cnt * (positive_cnt + negative_cnt) + (
    zero_cnt * (zero_cnt - 1) // 2
)
if K <= negative_pairs_cnt:
    ok, ng = 0, -(10**18)
    while abs(ok - ng) > 1:
        X = (ok + ng) // 2
        or_higher_cnt, r = 0, positive_start
        for l in range(negative_end):
            while (r < N) and (A[l] * A[r] > X):
                r += 1
            or_higher_cnt += positive_cnt - (r - positive_start)
        if or_higher_cnt >= K:
            ok = X
        else:
            ng = X
    print(ok)
elif K <= negative_pairs_cnt + zero_pairs_cnt:
    print((0))
else:
    K -= negative_pairs_cnt + zero_pairs_cnt
    ok, ng = 10**18, 0
    while abs(ok - ng) > 1:
        X = (ok + ng) // 2
        or_higher_cnt = 0
        r = N - 1
        for l in range(positive_start, N):
            while (r < N) and (A[l] * A[r] > X) and (l < r):
                r -= 1
            or_higher_cnt += max(0, r - l)
        l = 0
        for r in range(negative_end - 1, -1, -1):
            while (l < N) and (A[l] * A[r] > X) and (l < r):
                l += 1
            or_higher_cnt += max(0, r - l)
        if or_higher_cnt >= K:
            ok = X
        else:
            ng = X
    print(ok)

from bisect import bisect_left, bisect_right

n, k = list(map(int, input().split()))
a = sorted(list(map(int, input().split())))
pos_start = bisect_right(a, 0)
neg_end = bisect_left(a, 0)
pos_cnt = n - pos_start
neg_cnt = neg_end
pairs_cnt = n * (n - 1) // 2
pos_pairs_cnt = pos_cnt * (pos_cnt - 1) // 2 + neg_cnt * (neg_cnt - 1) // 2
neg_pairs_cnt = pos_cnt * neg_cnt
if k <= neg_pairs_cnt:
    high = 0
    low = -(10**18)
    while abs(high - low) > 1:
        mid = (high + low) // 2
        cnt = 0
        r = pos_start
        for l in range(neg_end):
            while r < n and mid < a[r] * a[l]:
                r += 1
            cnt += pos_cnt - (r - pos_start)
        if cnt >= k:
            high = mid
        else:
            low = mid
    print(high)
elif pairs_cnt - pos_pairs_cnt < k:
    k -= pairs_cnt - pos_pairs_cnt
    high = 10**18
    low = 0
    while abs(high - low) > 1:
        mid = (high + low) // 2
        cnt = 0
        r = n - 1
        for l in range(pos_start, n):
            while l < r and mid < a[r] * a[l]:
                r -= 1
            cnt += max(0, r - l)
        l = 0
        for r in range(neg_end - 1, -1, -1):
            while l < r and mid < a[r] * a[l]:
                l += 1
            cnt += max(0, r - l)
        if cnt >= k:
            high = mid
        else:
            low = mid
    print(high)
else:
    print((0))

-N, K = list(map(int, input().split())) -A = sorted(list(map(int, input().split()))) -negative_end = bisect_left(A, 0) -positive_start = bisect_right(A, 0) -positive_cnt = N - positive_start -negative_cnt = negative_end -zero_cnt = N - (positive_cnt + negative_cnt) -negative_pairs_cnt = positive_cnt * negative_cnt -zero_pairs_cnt = zero_cnt * (positive_cnt + negative_cnt) + ( -    zero_cnt * (zero_cnt - 1) // 2 -) -if K <= negative_pairs_cnt: -    ok, ng = 0, -(10**18) -    while abs(ok - ng) > 1: -        X = (ok + ng) // 2 -        or_higher_cnt, r = 0, positive_start -        for l in range(negative_end): -            while (r < N) and (A[l] * A[r] > X): +n, k = list(map(int, input().split())) +a = sorted(list(map(int, input().split()))) +pos_start = bisect_right(a, 0) +neg_end = bisect_left(a, 0) +pos_cnt = n - pos_start +neg_cnt = neg_end +pairs_cnt = n * (n - 1) // 2 +pos_pairs_cnt = pos_cnt * (pos_cnt - 1) // 2 + neg_cnt * (neg_cnt - 1) // 2 +neg_pairs_cnt = pos_cnt * neg_cnt +if k <= neg_pairs_cnt: +    high = 0 +    low = -(10**18) +    while abs(high - low) > 1: +        mid = (high + low) // 2 +        cnt = 0 +        r = pos_start +        for l in range(neg_end): +            while r < n and mid < a[r] * a[l]: -            or_higher_cnt += positive_cnt - (r - positive_start) -        if or_higher_cnt >= K: -            ok = X +            cnt += pos_cnt - (r - pos_start) +        if cnt >= k: +            high = mid -            ng = X -    print(ok) -elif K <= negative_pairs_cnt + zero_pairs_cnt: +            low = mid +    print(high) +elif pairs_cnt - pos_pairs_cnt < k: +    k -= pairs_cnt - pos_pairs_cnt +    high = 10**18 +    low = 0 +    while abs(high - low) > 1: +        mid = (high + low) // 2 +        cnt = 0 +        r = n - 1 +        for l in range(pos_start, n): +            while l < r and mid < a[r] * a[l]: +                r -= 1 +            cnt += max(0, r - l) +        l = 0 +        for r in range(neg_end - 1, -1, -1): +            while l < r and mid < a[r] * a[l]: +                l += 1 +            cnt += max(0, r - l) +        if cnt >= k: +            high = mid +        else: +            low = mid +    print(high) +else: -else: -    K -= negative_pairs_cnt + zero_pairs_cnt -    ok, ng = 10**18, 0 -    while abs(ok - ng) > 1: -        X = (ok + ng) // 2 -        or_higher_cnt = 0 -        r = N - 1 -        for l in range(positive_start, N): -            while (r < N) and (A[l] * A[r] > X) and (l < r): -                r -= 1 -            or_higher_cnt += max(0, r - l) -        l = 0 -        for r in range(negative_end - 1, -1, -1): -            while (l < N) and (A[l] * A[r] > X) and (l < r): -                l += 1 -            or_higher_cnt += max(0, r - l) -        if or_higher_cnt >= K: -            ok = X -        else: -            ng = X -    print(ok)