#include <bits/stdc++.h>
using namespace std;
int a[101];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    if (m >= (a[0] - 1))
      m -= (a[0] - 1);
    else {
      cout << m << endl;
      continue;
    }
    int c = 0;
    for (int i = 1; i < n; i++) {
      int fr2 = a[i] - a[i - 1];
      if (fr2 > 1) {
        if (m >= (fr2 - 1))
          m -= (fr2 - 1);
        else
          break;
      }
      c++;
    }
    cout << a[c] + m << endl;
  }
  return 0;
}
