Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import numpy as np
A=np.array(A,dtype="int64")
Z=A[A==0]
H=A[A<0]
S=A[A>0]
l,r=-10**19,10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  cnt+=A.searchsorted(mid//S,side="right").sum()
  cnt+=(N-A.searchsorted((-mid-1)//(-H),side="right")).sum()
  cnt-=np.count_nonzero(A*A<=mid)
  if mid>=0:
    cnt+=len(Z)*N 
  cnt//=2
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Fixed submission:
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import numpy as np
A=np.array(A,dtype="int64")
Z=A[A==0]
H=A[A<0]
S=A[A>0]
l,r=-10**19,10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  cnt+=A.searchsorted(mid//S,side="right").sum()
  cnt+=(N-A.searchsorted((-mid-1)//(-H),side="right")).sum()
  cnt-=np.count_nonzero(A*A<=mid)
  if mid>=0:
    cnt+=len(Z)*N 
  cnt//=2
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import bisect
#負の数がa個、0がb-a個
a=bisect.bisect_left(A,0)
b=bisect.bisect_right(A,0)
Z=A[a:b]
H=A[:a]
S=A[b:]
#print(H,Z,S,A)
l=-10**19
r=10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  #正×正・負×負が該当
  if mid>0:
    for i in S:
      d=bisect.bisect_right(S,mid//i)
      cnt+=d
  if mid>0:
    for i in H:
      d=bisect.bisect_right(H,(-mid-1)//(-i))
      cnt+=len(H)-d
  for i in A:
    if i!=0 and i**2<=mid:
      cnt-=1
  cnt//=2
  #0が含まれる計算が該当
  if mid>=0:
    e=len(S)+len(H)
    d=N*(N-1)//2-e*(e-1)//2
    cnt+=d
  
  #正×負の計算
  for i in S:
    d=bisect.bisect_right(H,mid//i)
    cnt+=d
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Fixed submission:
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import numpy as np
A=np.array(A,dtype="int64")
Z=A[A==0]
H=A[A<0]
S=A[A>0]
l,r=-10**19,10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  cnt+=A.searchsorted(mid//S,side="right").sum()
  cnt+=(N-A.searchsorted((-mid-1)//(-H),side="right")).sum()
  cnt-=np.count_nonzero(A*A<=mid)
  if mid>=0:
    cnt+=len(Z)*N 
  cnt//=2
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import bisect
#負の数がa個、0がb-a個
a=bisect.bisect_left(A,0)
b=bisect.bisect_right(A,0)
Z=A[a:b]
H=A[:a]
S=A[b:]
#print(H,Z,S,A)
l=-10**19
r=10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  #正×正・負×負が該当
  if mid>0:
    for i in S:
      d=bisect.bisect_right(S,mid//i)
      cnt+=d
  if mid>0:
    for i in H:
      d=bisect.bisect_right(H,(-mid-1)//(-i))
      cnt+=len(H)-d
  for i in A:
    if i!=0 and i**2<=mid:
      cnt-=1
  cnt//=2
  #0が含まれる計算が該当
  if mid>=0:
    e=len(S)+len(H)
    d=N*(N-1)//2-e*(e-1)//2
    cnt+=d
  
  #正×負の計算
  for i in S:
    d=bisect.bisect_right(H,mid//i)
    cnt+=d
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Fixed submission:
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import numpy as np
A=np.array(A,dtype="int64")
Z=A[A==0]
H=A[A<0]
S=A[A>0]
l,r=-10**19,10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  cnt+=A.searchsorted(mid//S,side="right").sum()
  cnt+=(N-A.searchsorted((-mid-1)//(-H),side="right")).sum()
  cnt-=np.count_nonzero(A*A<=mid)
  if mid>=0:
    cnt+=len(Z)*N 
  cnt//=2
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=sorted(A)
C=[]
import bisect
a=bisect.bisect_left(B,0)
b=bisect.bisect_right(B,0)
x=a
y=b-a
z=N-x-y
if x*z<K<=N-(z*(z-1)+x*(x-1)):
  print(0)
elif K<=x*z:
  for i in range(x):
    for j in range(x+y,N):
      C.append(B[i]*B[j])
  print(sorted(C)[K-1])
else:
  for i in range(x-1):
    for j in range(i+1,x):
      C.append(B[i]*B[j])
  for i in range(x+y,N-1):
    for j in range(i+1,N):
      C.append(B[i]*B[j])
  D=sorted(C)
  e=N*(N-1)//2
  print(D[-1*(e)-1+K])

Fixed submission:
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import numpy as np
A=np.array(A,dtype="int64")
Z=A[A==0]
H=A[A<0]
S=A[A>0]
l,r=-10**19,10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  cnt+=A.searchsorted(mid//S,side="right").sum()
  cnt+=(N-A.searchsorted((-mid-1)//(-H),side="right")).sum()
  cnt-=np.count_nonzero(A*A<=mid)
  if mid>=0:
    cnt+=len(Z)*N 
  cnt//=2
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=sorted(A)
C=[]
for i in range(N-1):
  for j in range(i+1,N):
    C.append(A[i]*A[j])
print(sorted(C)[K-1])

Fixed submission:
N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
import numpy as np
A=np.array(A,dtype="int64")
Z=A[A==0]
H=A[A<0]
S=A[A>0]
l,r=-10**19,10**19
while r-l>1:
  mid=(r+l)//2
  cnt=0
  cnt+=A.searchsorted(mid//S,side="right").sum()
  cnt+=(N-A.searchsorted((-mid-1)//(-H),side="right")).sum()
  cnt-=np.count_nonzero(A*A<=mid)
  if mid>=0:
    cnt+=len(Z)*N 
  cnt//=2
  if cnt>=K:
    r=mid
  else:
    l=mid 
print(r)