#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int tst, n, x, a[100];
  std::cin >> tst;
  while (tst--) {
    std::cin >> n >> x;
    for (int i = 0; i < n; i++) {
      std::cin >> a[i];
    }
    std::sort(a, a + n);
    x -= (a[0] - 1);
    int i = 1;
    while (i < n && (a[i] == a[i - 1] || (x - (a[i] - a[i - 1] - 1)) >= 0)) {
      if (a[i] == a[i - 1]) {
        i++;
        continue;
      }
      x -= (a[i] - a[i - 1] - 1);
      i++;
    }
    int result = a[i - 1] + x;
    if (x < 0) result = x + a[0] - 1;
    std::cout << result << std::endl;
  }
}
