|
||||||||||
Removed IntervalTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2841 Accepted Submission(s): 881 Problem Description Given a sequence of numbers $A=a_1,a_2,¡,a_N$, a subsequence $b_1,b_2,¡,b_k$ of $A$ is referred as increasing if $b_1<b_2<¡<b_k$. LY has just learned how to find the longest increasing subsequence (LIS). Now that he has to select $L$ consecutive numbers and remove them from $A$ for some mysterious reasons. He can choose arbitrary starting position of the selected interval so that the length of the LIS of the remaining numbers is maximized. Can you help him with this problem? Input The first line of input contains a number $T$ indicating the number of test cases ($T¡Ü100$). For each test case, the first line consists of two numbers $N$ and $L$ as described above ($1¡ÜN¡Ü100000,0¡ÜL¡ÜN$). The second line consists of $N$ integers indicating the sequence. The absolute value of the numbers is no greater than $10^9$. The sum of N over all test cases will not exceed 500000. Output For each test case, output a single line consisting of ¡°Case #X: Y¡±. $X$ is the test case number starting from 1. $Y$ is the maximum length of LIS after removing the interval. Sample Input
Sample Output
Source | ||||||||||
|