SP13588 ONEXLIS - One X LIS

Description

For a given sequence a\[1\], a\[2\], ... a\[n\], lets call a subsequence a\[k $ _{1} $ \], ...a\[k $ _{i} $ \]... a\[k $ _{m} $ \] (where 1

Input Format

First line contains t, which denotes the number of test cases. 2\*T lines follow. Each test case is described using 2 lines. First line of a test case contains an integer- n, which denotes the number of elements in the array. Second lines contains n integers, which represent a\[i\] 1

Output Format

For each test case, print one integer which represents the number of integers in the One X LIS. The output for each test case should be printed on a new line.