#include <bits/stdc++.h>
using namespace std;
bool used[111];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x, ans, y;
    cin >> n >> x;
    for (int i = 0; i < 111; i++) used[i] = false;
    for (int i = 0; i < n; i++) {
      cin >> y;
      used[y] = true;
    }
    y = 1;
    while (used[y] == true || x > 0) {
      if (used[y]) {
        y++;
        continue;
      }
      x--;
      y++;
    }
    y--;
    cout << y << endl;
  }
}
