import numpy as np



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



A = np.array(input().split(), np.int64)



A.sort()



posA = A[A > 0]

negA = A[A < 0]

zeros = (A==0).sum()



left = -10**18

right = 10**18



while left+1 < right:

    num = (left+right)//2

    

    less_count = 0

    

    if num >= 0:

        less_count += zeros * n

    

    limit_pair_for_pos = num // posA

    limit_idxs = np.searchsorted(A, limit_pair_for_pos, side='right')

    less_count += limit_idxs.sum()



    limit_pair_for_neg = -(num // -negA)

    limit_idxs = n - np.searchsorted(A, limit_pair_for_neg, side='left')

    less_count += limit_idxs.sum()



    duplicate_cases = (A**2 <= num).sum()

    less_count -= duplicate_cases

    less_count //= 2

    

    if less_count >= k:

        right = num

    else:

        left = num



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

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

pos = []

neg = []

zeros = 0

for a in A:

    if a > 0:

        pos.append(a)

    elif a < 0:

        neg.append(a)

    else:

        zeros += 1



pos.sort()

neg.sort(reverse=True)



minus_pattern = len(pos) * len(neg)

zero_pattern = zeros * (len(pos)+len(neg)) + (zeros*(zeros-1))//2



pos_length = len(pos)

neg_length = len(neg)



left = -10**18

right = 10**18



while left + 1 < right:

    num = (left+right)//2

    less_count = 0



    if num >= 0:

        pos_idx = pos_length-1

        for p in pos:

            while pos_idx >= 0 and p * pos[pos_idx] > num:

                pos_idx -= 1

            less_count += pos_idx + 1

            if p**2 <= num:

                less_count -= 1



        neg_idx = neg_length-1

        for m in neg:

            while neg_idx >= 0 and m * neg[neg_idx] > num:

                neg_idx -= 1

            less_count += neg_idx + 1

            if m**2 <= num:

                less_count -= 1



        less_count //= 2

        less_count += minus_pattern + zero_pattern



    elif num < 0:

        pos_idx = 0

        for m in neg[::-1]:

            while pos_idx < pos_length and m * pos[pos_idx] > num:

                pos_idx += 1

            less_count += pos_length - pos_idx



    if less_count >= k:

        right = num

    else:

        left = num



print(right)
import numpy as np

n, k = list(map(int, input().split()))
A = np.array(input().split(), np.int64)
A.sort()
posA = A[A > 0]
negA = A[A < 0]
zeros = (A == 0).sum()
left = -(10**18)
right = 10**18
while left + 1 < right:
    num = (left + right) // 2
    less_count = 0
    if num >= 0:
        less_count += zeros * n
    limit_pair_for_pos = num // posA
    limit_idxs = np.searchsorted(A, limit_pair_for_pos, side="right")
    less_count += limit_idxs.sum()
    limit_pair_for_neg = -(num // -negA)
    limit_idxs = n - np.searchsorted(A, limit_pair_for_neg, side="left")
    less_count += limit_idxs.sum()
    duplicate_cases = (A**2 <= num).sum()
    less_count -= duplicate_cases
    less_count //= 2
    if less_count >= k:
        right = num
    else:
        left = num
print(right)

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
pos = []
neg = []
zeros = 0
for a in A:
    if a > 0:
        pos.append(a)
    elif a < 0:
        neg.append(a)
    else:
        zeros += 1
pos.sort()
neg.sort(reverse=True)
minus_pattern = len(pos) * len(neg)
zero_pattern = zeros * (len(pos) + len(neg)) + (zeros * (zeros - 1)) // 2
pos_length = len(pos)
neg_length = len(neg)
left = -(10**18)
right = 10**18
while left + 1 < right:
    num = (left + right) // 2
    less_count = 0
    if num >= 0:
        pos_idx = pos_length - 1
        for p in pos:
            while pos_idx >= 0 and p * pos[pos_idx] > num:
                pos_idx -= 1
            less_count += pos_idx + 1
            if p**2 <= num:
                less_count -= 1
        neg_idx = neg_length - 1
        for m in neg:
            while neg_idx >= 0 and m * neg[neg_idx] > num:
                neg_idx -= 1
            less_count += neg_idx + 1
            if m**2 <= num:
                less_count -= 1
        less_count //= 2
        less_count += minus_pattern + zero_pattern
    elif num < 0:
        pos_idx = 0
        for m in neg[::-1]:
            while pos_idx < pos_length and m * pos[pos_idx] > num:
                pos_idx += 1
            less_count += pos_length - pos_idx
    if less_count >= k:
        right = num
    else:
        left = num
print(right)

-import numpy as np - -A = np.array(input().split(), np.int64) -A.sort() -posA = A[A > 0] -negA = A[A < 0] -zeros = (A == 0).sum() +A = list(map(int, input().split())) +pos = [] +neg = [] +zeros = 0 +for a in A: +    if a > 0: +        pos.append(a) +    elif a < 0: +        neg.append(a) +    else: +        zeros += 1 +pos.sort() +neg.sort(reverse=True) +minus_pattern = len(pos) * len(neg) +zero_pattern = zeros * (len(pos) + len(neg)) + (zeros * (zeros - 1)) // 2 +pos_length = len(pos) +neg_length = len(neg) -        less_count += zeros * n -    limit_pair_for_pos = num // posA -    limit_idxs = np.searchsorted(A, limit_pair_for_pos, side="right") -    less_count += limit_idxs.sum() -    limit_pair_for_neg = -(num // -negA) -    limit_idxs = n - np.searchsorted(A, limit_pair_for_neg, side="left") -    less_count += limit_idxs.sum() -    duplicate_cases = (A**2 <= num).sum() -    less_count -= duplicate_cases -    less_count //= 2 +        pos_idx = pos_length - 1 +        for p in pos: +            while pos_idx >= 0 and p * pos[pos_idx] > num: +                pos_idx -= 1 +            less_count += pos_idx + 1 +            if p**2 <= num: +                less_count -= 1 +        neg_idx = neg_length - 1 +        for m in neg: +            while neg_idx >= 0 and m * neg[neg_idx] > num: +                neg_idx -= 1 +            less_count += neg_idx + 1 +            if m**2 <= num: +                less_count -= 1 +        less_count //= 2 +        less_count += minus_pattern + zero_pattern +    elif num < 0: +        pos_idx = 0 +        for m in neg[::-1]: +            while pos_idx < pos_length and m * pos[pos_idx] > num: +                pos_idx += 1 +            less_count += pos_length - pos_idx