Problem Statement
We have
N
integers
A
1
,
A
2
,
.
.
.
,
A
N
.
There are
N
(
N
−
1
)
2
ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the
K
-th number in that list?
Constraints
All values in input are integers.
2<=N<=2x10^5
1<=k<=N(N-1)/2
-10^9 <=Ai<=10^9
can you help me in writing an optimized code.