SP21175 TAP2014H - Rush hour

Description

**\[Due to SPOJ restrictions, this problem has been modified with respect to the original version used in the Argentinian Programming Tournament of 2014 in order to have multiple test cases per input file.** [http://dc.uba.ar/events/icpc/download/problems/tap2014-problems.pdf](http://dc.uba.ar/events/icpc/download/problems/tap2014-problems.pdf "http://dc.uba.ar/events/icpc/download/problems/tap2014-problems.pdf") \] Nlogonia is a very organized city, where the houses of the inhabitants are all located on the East End of the city and their workplaces are located on the West End.

Input Format

The first line contains an integer number **T**, the number of test cases (**1 ). **T** test cases follow.** The first line of each test case contains an integer **N** indicating the number of train services in Nlogonia (**1 ****10 $ ^{5} $** ). The second line contains **N** different integers **E $ _{1} $ , E $ _{2} $ , ..., E $ _{N} $** (**1 ), indicating that the train leaving the **i**-th station on the West should get to station **E $ _{i} $** on the East, for **i = 1, 2, ..., N**.******

Output Format

For each test case, print a line containing a single integer representing the minimum number of turns in which the services can be planned.