#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int x, t, n, holder;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    vector<bool> found(100, false);
    for (int i = 0; i < n; i++) {
      cin >> holder;
      found[holder - 1] = true;
    }
    for (int i = 0; i < found.size(); i++) {
      if (!found[i] && x != 0) {
        x--;
        found[i] = 1;
      }
    }
    int count = -1;
    for (int i = 0; i < found.size(); i++) {
      if (!found[i]) {
        count = i;
        break;
      }
    }
    if (count != -1) {
      cout << count << endl;
    } else {
      cout << found.size() + x << endl;
    }
  }
  return 0;
}
