Given a set of integers (it can contain equal elements).

You have to split it into two subsets $A$ and $B$ (both of them can contain equal elements or be empty). You have to maximize the value of $mex(A)+mex(B)$.

Here $mex$ of a set denotes the smallest non-negative integer that doesn't exist in the set. For example:   $mex(\{1,4,0,2,2,1\})=3$  $mex(\{3,3,2,1,3,0,0\})=4$  $mex(\varnothing)=0$ ($mex$ for empty set) 

The set is splitted into two subsets $A$ and $B$ if for any integer number $x$ the number of occurrences of $x$ into this set is equal to the sum of the number of occurrences of $x$ into $A$ and the number of occurrences of $x$ into $B$.


-----Input-----

The input consists of multiple test cases. The first line contains an integer $t$ ($1\leq t\leq 100$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains an integer $n$ ($1\leq n\leq 100$) — the size of the set.

The second line of each testcase contains $n$ integers $a_1,a_2,\dots a_n$ ($0\leq a_i\leq 100$) — the numbers in the set.


-----Output-----

For each test case, print the maximum value of $mex(A)+mex(B)$.


-----Example-----
Input
4
6
0 2 1 5 0 1
3
0 1 2
4
0 2 0 1
6
1 2 3 4 5 6

Output
5
3
4
0



-----Note-----

In the first test case, $A=\left\{0,1,2\right\},B=\left\{0,1,5\right\}$ is a possible choice.

In the second test case, $A=\left\{0,1,2\right\},B=\varnothing$ is a possible choice.

In the third test case, $A=\left\{0,1,2\right\},B=\left\{0\right\}$ is a possible choice.

In the fourth test case, $A=\left\{1,3,5\right\},B=\left\{2,4,6\right\}$ is a possible choice.

Difficulty: interview

Starter code:

Solutions:
for _ in range(int(input())):
    n = int(input())
    arr = list(map(int,input().split()))
    a,b = 0,0
    arr.sort()
    for i in arr:
        if a==i:
            a+=1
        elif b==i:
            b+=1
    print(a+b)

from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop,heapify
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

from itertools import accumulate
from functools import lru_cache

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)
 
def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]

for _ in range(val()):
    n = val()
    l = sorted(li())

    a1 = set()
    a2 = set()
    for i in l:
        if i in a1:
            a2.add(i)
        else:a1.add(i)
    ans = 0
    for i in range(200):
        if i not in a1:
            ans += i
            break
    for i in range(200):
        if i not in a2:
            ans += i
            break
    print(ans)

def read_int():
    return int(input())


def read_ints():
    return list(map(int, input().split(' ')))


t = read_int()
for case_num in range(t):
    n = read_int()
    a = list(read_ints())
    cnt = [0 for _ in range(101)]
    for i in a:
        cnt[i] += 1
    ans = 0
    status = 2
    for i in range(101):
        status = min(status, cnt[i])
        if status == 0:
            break
        ans += status
    print(ans)


for _ in range(int(input())):
    n=int(input())
    mxa=mxb=0
    for i in sorted(map(int,input().split())):
        if i==mxa:mxa+=1
        elif i==mxb:mxb+=1
    print(mxa+mxb)


import sys
import heapq, functools, collections
import math, random
from collections import Counter, defaultdict

# available on Google, not available on Codeforces
# import numpy as np
# import scipy


def solve(lst):  # fix inputs here
    console("----- solving ------")

    c = Counter(lst)

    cur = 0
    while True:
        if c[cur] < 2:
            a = cur
            break
        cur += 1

    while True:
        if c[cur] < 1:
            b = cur
            break
        cur += 1

    # return a string (i.e. not a list or matrix)
    return a + b  


def console(*args):  # the judge will not read these print statement
    print('\033[36m', *args, '\033[0m', file=sys.stderr)
    return

# fast read all
# sys.stdin.readlines()

for case_num in range(int(input())):
    # read line as a string
    # strr = input()

    # read line as an integer
    k = int(input())
    
    # read one line and parse each word as a string
    # lst = input().split()

    # read one line and parse each word as an integer
    lst = list(map(int,input().split()))

    # read matrix and parse as integers (after reading read nrows)
    # lst = list(map(int,input().split()))
    # nrows = lst[0]  # index containing information, please change
    # grid = []
    # for _ in range(nrows):
    #     grid.append(list(map(int,input().split())))

    res = solve(lst)  # please change
    
    # Google - case number required
    # print("Case #{}: {}".format(case_num+1, res))

    # Codeforces - no case number required
    print(res)


import sys
from sys import stdout
import random
from fractions import Fraction
from math import *
 
def input():
    return sys.stdin.readline().strip()
 
def iinput():
    return int(input())

def finput():
    return float(input())

def tinput():
    return input().split()

def linput():
    return list(input())
 
def rinput():
    return list(map(int, tinput()))

def fiinput():
    return list(map(float, tinput()))
 
def rlinput():
    return list(map(int, input().split()))
def trinput():
    return tuple(rinput())

def srlinput():
    return sorted(list(map(int, input().split())))

def NOYES(fl):
    if fl:
        print("NO")
    else:
        print("YES")
def YESNO(fl):
    if fl:
        print("YES")
    else:
        print("NO")
    
def main():
    n = iinput()
    #k = iinput() 
    #m = iinput() 
    #n = int(sys.stdin.readline().strip()) 
    #n, k = rinput()
    #n, m = rinput()
    #m, k = rinput()
    #n, k, m = rinput()
    #n, m, k = rinput()
    #k, n, m = rinput()
    #k, m, n = rinput() 
    #m, k, n = rinput()
    #m, n, k = rinput()
    #q = srlinput()
    #q = linput()
    q = srlinput()
    w = set([i for i in range(105)])
    res = list(w - set(q))[0]
    for i in range(res):
        del q[q.index(i)]
    print(list(w - set(q))[0] + res)
    
        
    
    
        
    

for i in range(iinput()):
    main()


for _ in range(int(input())):
    n = int(input())
    freq = [0] * 101
    for e in map(int, input().split()):
        freq[e] += 1
    res = 0
    one = False
    for i in range(101):
        if freq[i] == 0:
            break
        if one:
            res += 1
        else:
            if freq[i] > 1:
                res += 2
            else:
                one = True
                res += 1
    print(res)


def solve():
    n = int(input())
    a = list(map(int, input().split()))
    u = 0
    for i in range(n + 1):
        if a.count(i) < 2:
            u = i
            break
    v = 0
    for i in range(n + 1):
        if a.count(i) < 1:
            v = i
            break
    print(u + v)

t = int(input())
for _ in range(t):
    solve()

import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	n = II()
	a = LI()
	d = [0]*101
	for i in range(n):
		d[a[i]]+=1
	ans = 0
	boo = False
	for i in range(101):
		if boo == False and d[i]<2:
			ans+=i
			boo = True
		if boo == True and d[i]<1:
			ans+=i
			break
	print(ans)

for t in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))

    a1 = 200
    a2 = 200
    for i in range(200, -1, -1):
        if l.count(i) < 2:
            a2 = i
        if l.count(i) < 1:
            a1 = i
    print(a1+a2)


t = int(input())

for i in range(t):
    n = int(input())
    k = list(map(int, input().split()))
    m1, m2 = 0, 0
    for i in range(101):
        if k.count(i) < 2:
            m1 = i
            break
    for i in range(m1, 101):
        if k.count(i) < 1:
            m2 = i
            break
    print(m1+m2)