import sys

input = sys.stdin.readline

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

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

A.sort()

A00 = A[:]



A0 = []

A1 = []



F = [0,0,0]

for i in range(n):

    if A[i] > 0:

        F[0] += 1

        A0.append(A[i])

    elif A[i] == 0:

        F[1] += 1

    else:

        F[2] += 1

        A1.append(A[i])

G = [F[2]*(F[2]-1)//2 + F[0]*(F[0]-1)//2,

 (F[0]+F[2]) * F[1] + F[1]*(F[1]-1)//2,

  F[2] * F[0]]

# print("G",G)

g = 2

if G[2] < k and G[2]+G[1] >= k:

    k -= G[2]

    g = 1

if G[2]+G[1] < k:

    k -= G[2]+G[1]

    g = 0

if g==2:

    k = n*(n-1)//2 + 1 - k  # 上からk番目

    k -= G[0]+G[1]  # 負になるペアの中で上からk番目

    

k -= 1 # これで「それより絶対値が下の数がk個」になる

# print("k",k)



# print("g",g)



if g==1:

    print((0))

elif g==0:

    A = A0[:]

    B = [-i for i in A1]

    B.sort()

    le = -1

    ri = 10**18+2

    m = (le+ri) // 2

    while ri-le > 1:

        ans = 0

        if len(A) > 0:

            j0 = len(A)-1

            for i in range(len(A)):

                while j0 > i and A[i]*A[j0] >= m:

                    j0 -= 1

                ans += j0-i

                j0 = max(i+1,j0)

        if len(B) > 0:

            j1 = len(B)-1

            for i in range(len(B)):

                while j1 > i and B[i]*B[j1] >= m:

                    j1 -= 1

                ans += j1-i

                j1 = max(i+1,j1)

        # print(le,ri,m,ans) # ansはm未満の数の個数

        if ans > k:

            ri = m

        else:

            le = m

        m = (le+ri)//2

    print(le)

else:

    # print("k",k)

    A = A0[:]

    B = [-i for i in A1]

    B.sort()

    # print(A,B)



    le = -1

    ri = 10**18+2

    m = (le+ri) // 2

    while ri-le > 1:

        ans = 0

        if len(A) > 0:

            j0 = len(B)-1

            for i in range(len(A)):

                # print("seki",A[i]*B[j0])

                while j0 >= 0 and A[i]*B[j0] >= m:

                    

                    j0 -= 1

                ans += j0+1

                # print("plus",j0)

        # print(le,ri,m,ans) # ansはm未満の数の個数

        if ans > k:

            ri = m

        else:

            le = m

        m = (le+ri)//2

    print((-le))







# CC = []

# A = A00[:]

# for i in range(n):

#     for j in range(i+1,n):

#         CC.append(A[i]*A[j])

# CC.sort()

# print("lenCC", len(CC))

# print(CC)

# print(CC[400:420])
import sys

input = sys.stdin.readline

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

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



minus = 0

for i in range(n):

    if A[i] < 0:

        minus += 1

zplus = n - minus



B = []

C = []

for i in range(n):

    if A[i] < 0:

        C.append(A[i])

    else:

        B.append(A[i])

B.sort(reverse=True)

C.sort()





if k <= minus * zplus:

    ok = 1

    ng = -10**20

    m = (ok+ng) // 2

    while abs(ng-ok) > 1:

        co = 0

        j = len(C)-1

        for i in range(len(B)):

            while j >= 0 and B[i]*C[j] > m:

                j -= 1

            co += j+1

        # print(m, co)

        if co >= k:

            ok = m

            # print("ok")

        else:

            ng = m

            # print("ng")

        m = (ok+ng) // 2

    print(ok)

else:

    k -= minus * zplus

    ok = 10**20

    ng = -1

    m = (ok+ng) // 2

    while abs(ng-ok) > 1:

        co = 0

        j = len(C)-1

        for i in range(len(C)):

            while j > i and C[i]*C[j] <= m:

                j -= 1

            co += len(C)-1-j

            j = max(j, i+1)

        j = len(B)-1

        for i in range(len(B)):

            while j > i and B[i]*B[j] <= m:

                j -= 1

            co += len(B)-1-j

            j = max(j, i+1)



        if co >= k:

            ok = m

            # print("ok")

        else:

            ng = m

            # print("ng")

        m = (ok+ng) // 2

    print(ok)
import sys

input = sys.stdin.readline
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
A00 = A[:]
A0 = []
A1 = []
F = [0, 0, 0]
for i in range(n):
    if A[i] > 0:
        F[0] += 1
        A0.append(A[i])
    elif A[i] == 0:
        F[1] += 1
    else:
        F[2] += 1
        A1.append(A[i])
G = [
    F[2] * (F[2] - 1) // 2 + F[0] * (F[0] - 1) // 2,
    (F[0] + F[2]) * F[1] + F[1] * (F[1] - 1) // 2,
    F[2] * F[0],
]
# print("G",G)
g = 2
if G[2] < k and G[2] + G[1] >= k:
    k -= G[2]
    g = 1
if G[2] + G[1] < k:
    k -= G[2] + G[1]
    g = 0
if g == 2:
    k = n * (n - 1) // 2 + 1 - k  # 上からk番目
    k -= G[0] + G[1]  # 負になるペアの中で上からk番目
k -= 1  # これで「それより絶対値が下の数がk個」になる
# print("k",k)
# print("g",g)
if g == 1:
    print((0))
elif g == 0:
    A = A0[:]
    B = [-i for i in A1]
    B.sort()
    le = -1
    ri = 10**18 + 2
    m = (le + ri) // 2
    while ri - le > 1:
        ans = 0
        if len(A) > 0:
            j0 = len(A) - 1
            for i in range(len(A)):
                while j0 > i and A[i] * A[j0] >= m:
                    j0 -= 1
                ans += j0 - i
                j0 = max(i + 1, j0)
        if len(B) > 0:
            j1 = len(B) - 1
            for i in range(len(B)):
                while j1 > i and B[i] * B[j1] >= m:
                    j1 -= 1
                ans += j1 - i
                j1 = max(i + 1, j1)
        # print(le,ri,m,ans) # ansはm未満の数の個数
        if ans > k:
            ri = m
        else:
            le = m
        m = (le + ri) // 2
    print(le)
else:
    # print("k",k)
    A = A0[:]
    B = [-i for i in A1]
    B.sort()
    # print(A,B)
    le = -1
    ri = 10**18 + 2
    m = (le + ri) // 2
    while ri - le > 1:
        ans = 0
        if len(A) > 0:
            j0 = len(B) - 1
            for i in range(len(A)):
                # print("seki",A[i]*B[j0])
                while j0 >= 0 and A[i] * B[j0] >= m:
                    j0 -= 1
                ans += j0 + 1
                # print("plus",j0)
        # print(le,ri,m,ans) # ansはm未満の数の個数
        if ans > k:
            ri = m
        else:
            le = m
        m = (le + ri) // 2
    print((-le))
# CC = []
# A = A00[:]
# for i in range(n):
#     for j in range(i+1,n):
#         CC.append(A[i]*A[j])
# CC.sort()
# print("lenCC", len(CC))
# print(CC)
# print(CC[400:420])

import sys

input = sys.stdin.readline
n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
minus = 0
for i in range(n):
    if A[i] < 0:
        minus += 1
zplus = n - minus
B = []
C = []
for i in range(n):
    if A[i] < 0:
        C.append(A[i])
    else:
        B.append(A[i])
B.sort(reverse=True)
C.sort()
if k <= minus * zplus:
    ok = 1
    ng = -(10**20)
    m = (ok + ng) // 2
    while abs(ng - ok) > 1:
        co = 0
        j = len(C) - 1
        for i in range(len(B)):
            while j >= 0 and B[i] * C[j] > m:
                j -= 1
            co += j + 1
        # print(m, co)
        if co >= k:
            ok = m
            # print("ok")
        else:
            ng = m
            # print("ng")
        m = (ok + ng) // 2
    print(ok)
else:
    k -= minus * zplus
    ok = 10**20
    ng = -1
    m = (ok + ng) // 2
    while abs(ng - ok) > 1:
        co = 0
        j = len(C) - 1
        for i in range(len(C)):
            while j > i and C[i] * C[j] <= m:
                j -= 1
            co += len(C) - 1 - j
            j = max(j, i + 1)
        j = len(B) - 1
        for i in range(len(B)):
            while j > i and B[i] * B[j] <= m:
                j -= 1
            co += len(B) - 1 - j
            j = max(j, i + 1)
        if co >= k:
            ok = m
            # print("ok")
        else:
            ng = m
            # print("ng")
        m = (ok + ng) // 2
    print(ok)

-A.sort() -A00 = A[:] -A0 = [] -A1 = [] -F = [0, 0, 0] +minus = 0 -    if A[i] > 0: -        F[0] += 1 -        A0.append(A[i]) -    elif A[i] == 0: -        F[1] += 1 +    if A[i] < 0: +        minus += 1 +zplus = n - minus +B = [] +C = [] +for i in range(n): +    if A[i] < 0: +        C.append(A[i]) -        F[2] += 1 -        A1.append(A[i]) -G = [ -    F[2] * (F[2] - 1) // 2 + F[0] * (F[0] - 1) // 2, -    (F[0] + F[2]) * F[1] + F[1] * (F[1] - 1) // 2, -    F[2] * F[0], -] -# print("G",G) -g = 2 -if G[2] < k and G[2] + G[1] >= k: -    k -= G[2] -    g = 1 -if G[2] + G[1] < k: -    k -= G[2] + G[1] -    g = 0 -if g == 2: -    k = n * (n - 1) // 2 + 1 - k  # 上からk番目 -    k -= G[0] + G[1]  # 負になるペアの中で上からk番目 -k -= 1  # これで「それより絶対値が下の数がk個」になる -# print("k",k) -# print("g",g) -if g == 1: -    print((0)) -elif g == 0: -    A = A0[:] -    B = [-i for i in A1] -    B.sort() -    le = -1 -    ri = 10**18 + 2 -    m = (le + ri) // 2 -    while ri - le > 1: -        ans = 0 -        if len(A) > 0: -            j0 = len(A) - 1 -            for i in range(len(A)): -                while j0 > i and A[i] * A[j0] >= m: -                    j0 -= 1 -                ans += j0 - i -                j0 = max(i + 1, j0) -        if len(B) > 0: -            j1 = len(B) - 1 -            for i in range(len(B)): -                while j1 > i and B[i] * B[j1] >= m: -                    j1 -= 1 -                ans += j1 - i -                j1 = max(i + 1, j1) -        # print(le,ri,m,ans) # ansはm未満の数の個数 -        if ans > k: -            ri = m +        B.append(A[i]) +B.sort(reverse=True) +C.sort() +if k <= minus * zplus: +    ok = 1 +    ng = -(10**20) +    m = (ok + ng) // 2 +    while abs(ng - ok) > 1: +        co = 0 +        j = len(C) - 1 +        for i in range(len(B)): +            while j >= 0 and B[i] * C[j] > m: +                j -= 1 +            co += j + 1 +        # print(m, co) +        if co >= k: +            ok = m +            # print("ok") -            le = m -        m = (le + ri) // 2 -    print(le) +            ng = m +            # print("ng") +        m = (ok + ng) // 2 +    print(ok) -    # print("k",k) -    A = A0[:] -    B = [-i for i in A1] -    B.sort() -    # print(A,B) -    le = -1 -    ri = 10**18 + 2 -    m = (le + ri) // 2 -    while ri - le > 1: -        ans = 0 -        if len(A) > 0: -            j0 = len(B) - 1 -            for i in range(len(A)): -                # print("seki",A[i]*B[j0]) -                while j0 >= 0 and A[i] * B[j0] >= m: -                    j0 -= 1 -                ans += j0 + 1 -                # print("plus",j0) -        # print(le,ri,m,ans) # ansはm未満の数の個数 -        if ans > k: -            ri = m +    k -= minus * zplus +    ok = 10**20 +    ng = -1 +    m = (ok + ng) // 2 +    while abs(ng - ok) > 1: +        co = 0 +        j = len(C) - 1 +        for i in range(len(C)): +            while j > i and C[i] * C[j] <= m: +                j -= 1 +            co += len(C) - 1 - j +            j = max(j, i + 1) +        j = len(B) - 1 +        for i in range(len(B)): +            while j > i and B[i] * B[j] <= m: +                j -= 1 +            co += len(B) - 1 - j +            j = max(j, i + 1) +        if co >= k: +            ok = m +            # print("ok") -            le = m -        m = (le + ri) // 2 -    print((-le)) -# CC = [] -# A = A00[:] -# for i in range(n): -#     for j in range(i+1,n): -#         CC.append(A[i]*A[j]) -# CC.sort() -# print("lenCC", len(CC)) -# print(CC) -# print(CC[400:420]) +            ng = m +            # print("ng") +        m = (ok + ng) // 2 +    print(ok)