##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
Nasser gives you an array of length consisting of positive integers.
Nasser and Fady will play a game consisting of exactly turns. Nasser takes the first turn. The game proceeds as follows:
Nasser wants to maximize the MEX of the final array after all turns, while Fady wants to minimize it.
Both players play optimally. Your task is to help Nasser determine the maximum possible MEX value he can guarantee after turns.
The MEX (Minimum EXcluded) of an array is the smallest non-negative integer that does not appear in the array. For example:
Each test contains multiple test cases. The first line contains a single integer - the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers and - the length of the array and the number of turns.
The second line of each test case contains integers - the elements of the array.
It is guaranteed that the sum of over all test cases does not exceed .
, , :
, , :