596. K-th Smallest Prime Fraction

0

Medium

Given a sorted array arr containing 1 and prime numbers, where all the elements of arr are unique, and an integer k, find the kth smallest fraction in the array.

Input Format

The first line contains the size of the array. The second line contains the elements of the array. The third line contains the value of k.

Output Format

Print your answer as an array of integers of size 2, where answer[0] is equal to arr[i] and answer[1] is equal to arr[j].

Example

Input

4 1 2 3 5 3

Output

2 5

Constraints

2 <= arr.length <= 1000
1 <= arr[i] <= 3 * 104
arr[0] == 1
arr[i] is a prime number for i > 0.
All the numbers of arr are unique and sorted in strictly increasing order.
1 <= k <= arr.length * (arr.length - 1) / 2
Loading...

View Submissions

Console