Computer Science, asked by wwwdishanthmc01, 9 hours ago

You are given a multi-set S of N integers, and an integer K. You want to find the maximum value of minimal excluded non-negative integer (MEX) of the multi-set given that you are allowed to add at most any K integers to the multi-set. Find the maximum value of MEX that you can obtain. Few examples of finding MEX of a multi-set are as follows. MEX of multi-set {0} is 1, {1} is 0, {0, 1, 3} is 2, {0, 1, 2, 3, 5, 6} is 4. Input The first line of the input contains an integer T denoting the number of testcases. The first line of each test case contains two space seperated integers N and K denoting the size of the multi-set and the maximum number of extra integers that you can add in the multi-set respectively. The second line contains N space separated integers denoting the multi-set S: S1, S2 ,.... SN. Output For each testcase, output the answer in a single line. Constraints 1 ≤ T ≤ 10 1 ≤ N ≤ 105 0 ≤ K ≤ 105 0 ≤ Si ≤ 2 * 105

Answers

Answered by rajeevsingh89036
1

Answer:

bad for her and I have no how to make it and your body and I have no how to make it

Similar questions