786. K-th Smallest Prime Fraction
A sorted list A
contains 1, plus some number of primes. Then, for every p < q in the list, we consider the fraction p/q.
What is the K
-th smallest fraction considered? Return your answer as an array of ints, where answer[0] = p
and answer[1] = q
.
Note:
A
will have length between2
and2000
.Each
A[i]
will be between1
and30000
.K
will be between1
andA.length * (A.length - 1) / 2
.
Last updated
Was this helpful?