Haidora and tubes#12295

Haidora and tubes

2 seconds
256 megabytes
Easy

Haidora has tubes, and each of them has a diameter a_i. He wants to link these tubes together. Unfortunately, there is a rule for linking tubes. You can link tubes (1 \leq i,j \leq n and i \neq j) with diameters a_i,a_j respectively if and only if |a_i-a_j| \leq 1. Haidora might not be able to link all tubes, so he wants to find the maximum number of tubes that he can link together. Can you find it for Haidora?

Input

The first line contains a single integer (1 \leq t \leq 10000): the number of test cases.

The first line of each test case contains a single integer (1 \le n \le 2000) — the length of array .

The second line of each test case contains separated integers a_1,a_2,..,a_n (1 \le a_1,a_2,..,a_n \le 10^9) — the array .

It is guaranteed that the sum of over all test cases does not exceed .

Output

For each test case, output a single integer: the maximum number of tubes that you can link.

Examples

Example 1

Loading
Loading

Note

In the first test case, we can obtain the maximum number of tubes that we can link by connecting

1 \mapsto 2 \mapsto 2 \mapsto 3 \mapsto 4 \mapsto 5 \mapsto 6

In the second test case, we can obtain the maximum number of tubes that we can link by connecting

2 \mapsto 3 \mapsto 3

Scoring

  1. Subtask ( points) : (1 \le a_i \le 2)

  2. Subtask ( points) : No additional constraints