## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

# [Solution] Positive array CodeChef Solution

1-indexed array is called positive if every element of the array is greater than or equal to the index on which it lies. Formally, an array $B$ of size $M$ is called positive if ${B}_{i}\ge i$ for each $1\le i\le M$.

For example, the arrays $\left[1\right],\left[2,2\right],\left[3,2,4,4\right]$ are positive while the arrays $\left[2,1\right],\left[3,1,2\right]$ are not positive.

You are given an array $A$ containing $N$ integers. You want to distribute all elements of the array into some positive arrays. The elements of a positive array might not occur in the order they appear in the array $A$.

Find the minimum number of positive arrays that the elements of the array $A$ can be divided into.

Solution Click Below:-  👉
👇👇👇👇👇

Please see the sample cases below for more clarity.

### Input Format

• The first line of input will contain a single integer $T$, denoting the number of test cases.

• Each test case consists of two lines of input.
• The first line of each test case contains an integer $N$ — the number of elements in the array $A$.
• The next line contains $N$ space-separated integers ${A}_{1},{A}_{2},\dots ,{A}_{N}$ — the elements of array $A$.

### Output Format

For each test case, output on a new line the minimum number of positive arrays that the elements of the array $A$ can be divided into.​

### Constraints

• $1\le T\le {10}^{4}$
• $1\le N\le {10}^{5}$
• $1\le {A}_{i}\le N$
• The sum of $N$ over all test cases won't exceed