Problem H: Kth Longest Length

Problem H: Kth Longest Length

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 145  Solved: 22
[Submit][Status][Web Board]

Description

Giving you three integers: n, m, k and a sequence {an}. The elements in {an} are distinct. Please find the longest continuous subsequence whose kth smallest element is as large as possible. And the subsequence’s length is larger than or equal to m. Please print the length of the subsequence.

Input

The first line is an integer T, which is the number of test cases. (1 <= T <= 10)

Each test case begins with three integers, n, m and k. (1 <= n <= 300000, 1 <= k <= m <= n)

Then n integers represent the elements in {an}. (1 <= ai <= 107)

Output

An integer for each test case, the length problem required.

Sample Input

1
5 3 2
1 5 3 2 4

Sample Output

4

HINT

Bonus problem

[Submit][Status]