# CSEPL

After placements, all the boys of CSE branch have no work to do. So, they decide to play CSE Cricket Premier League. There are N teams. For every match played, the winner gets 2 points and losing team gets 0 points. If the outcome is draw, both teams get 1 points each. Different teams may have played different number of matches.

Given the number of teams and the points obtained by each of them, find the minimum number of matches that have been played in the tournament. If the points doesn't represent a valid state, print -1.

**Input Specifications**

First line contains the number of test cases. Every test is consists of two lines. First line contains a single integer N. Second line contains N integers representing the points (P

_{i}) of N teams .

**Output Specifications**

For every test case print the minimum number of matches that have been played in the tournament. If the points doesn't represent a valid state, print -1.

**Constraints**

T <= 100

N <= 100

0 <= P

_{i}<= 100

**Sample Test Cases**

*Input*

```
```

4

3

10 1 1

3

1 1 1

6

0 0 0 0 0 0

3

13 8 7

*Output*

```
```

6

-1

0

14

*Problem Setter : Shikhar Sharad*

**Languages:**AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text