Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N,K = map(int, input().split())
    A = np.array(sorted([int(i) for i in input().split()]))

    zero_left = np.searchsorted(A, 0, side='left')
    zero_right = np.searchsorted(A, 0, side='right')

    negative = zero_left
    positive = N - zero_right
    zero = zero_right - zero_left
    non_posi = negative * positive + zero * (N - zero) + zero * (zero - 1) // 2

    if K <= negative * positive:
        Nega = A[:zero_left]
        Posi = A[zero_right:]

        left = -(A[0]**2)
        right = 0
        while right - left > 1:
            x = (left + right) // 2
            count = np.searchsorted(Nega, x // Posi, side='right').sum()

            if count < K:
                left = x
            else:
                right = x

        print(right)

    elif K <= non_posi:
        print(0)

    else:
        Nega = np.sort(np.abs(A[:zero_left]))
        Posi = A[zero_right:]

        left = 0
        right = Posi[-1]**2
        while right - left > 1:
            x = (left + right) // 2
            A = np.searchsorted(Nega, x // Nega, side='right')
            B = np.searchsorted(Posi, x // Posi, side='right')
            count = 0
            count += A.sum()
            count += B.sum()
            count -= np.int_(np.where(A >= np.arange(1,negative+1), True, False)).sum()
            count -= np.int_(np.where(B >= np.arange(1,positive+1), True, False)).sum()
            count //= 2

            if count + non_posi < K:
                left = x
            else:
                right = x

        print(right)


if __name__ == "__main__":
    main()


Fixed submission:
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N,K = map(int, input().split())
    A = np.array(sorted([int(i) for i in input().split()]))

    negative = A[A < 0]
    positive = A[A > 0]
    ln = len(negative)
    lp = len(positive)
    zero = np.count_nonzero(A == 0)

    def count(x):
        count = 0
        if x >= 0:
            count += N * zero
        count += np.searchsorted(A, x // positive, side='right').sum()
        count += N * ln - np.searchsorted(A, -(-x // negative), side='left').sum()
        count -= np.count_nonzero(A * A <= x)
        count //= 2

        return count


    left = -(10**18)
    right = 10**18
    while right - left > 1:
        x = (left + right) // 2
        if count(x) < K:
            left = x
        else:
            right = x

    print(right)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N,K = map(int, input().split())
    A = np.array(sorted([int(i) for i in input().split()]))

    zero_left = np.searchsorted(A, 0, side='left')
    zero_right = np.searchsorted(A, 0, side='right')

    negative = zero_left
    positive = N - zero_right
    zero = zero_right - zero_left
    non_posi = negative * positive + zero * (N - zero) + zero * (zero - 1) // 2

    if K <= negative * positive:
        Nega = A[:zero_left]
        Posi = A[zero_right:]

        left = -(A[0]**2)
        right = 0
        while right - left > 1:
            x = (left + right) // 2
            count = np.searchsorted(Nega, x // Posi, side='right').sum()

            if count < K:
                left = x
            else:
                right = x

        print(right)

    elif K <= non_posi:
        print(0)

    else:
        Nega = np.sort(np.abs(A[:zero_left]))
        Posi = A[zero_right:]

        left = 0
        right = 10**18
        while right - left > 1:
            x = (left + right) // 2
            count = 0
            count += np.searchsorted(Nega, x // Nega, side='right').sum()
            count += np.searchsorted(Posi, x // Posi, side='right').sum()
            count -= np.int_(np.where(np.searchsorted(Nega, x // Nega) >= np.arange(1,negative+1), True, False)).sum()
            count -= np.int_(np.where(np.searchsorted(Posi, x // Posi) >= np.arange(1,positive+1), True, False)).sum()
            count //= 2

            if count + non_posi < K:
                left = x
            else:
                right = x

        print(right)


if __name__ == "__main__":
    main()


Fixed submission:
import numpy as np
import sys
input = sys.stdin.readline


def main():
    N,K = map(int, input().split())
    A = np.array(sorted([int(i) for i in input().split()]))

    negative = A[A < 0]
    positive = A[A > 0]
    ln = len(negative)
    lp = len(positive)
    zero = np.count_nonzero(A == 0)

    def count(x):
        count = 0
        if x >= 0:
            count += N * zero
        count += np.searchsorted(A, x // positive, side='right').sum()
        count += N * ln - np.searchsorted(A, -(-x // negative), side='left').sum()
        count -= np.count_nonzero(A * A <= x)
        count //= 2

        return count


    left = -(10**18)
    right = 10**18
    while right - left > 1:
        x = (left + right) // 2
        if count(x) < K:
            left = x
        else:
            right = x

    print(right)


if __name__ == "__main__":
    main()