#d1601. 并行排序
并行排序
Parallel Sort
Problem Description
You are given an integer and a permutation of length . Draw an edge between two positions and if and . Now you must color the vertices so that the two endpoints of every edge have different colors, using as few colors as possible. Output the minimum number of colors used.
Input Format
The first line contains an integer , the number of test cases.
For each test case, the first line contains an integer .
The next line contains integers .
Output Format
One number: the minimum number of colors needed.
Sample Input
2
4
1 3 4 2
2
1 2
Sample Output
2
1
Constraints
For all data, .