#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t, n, x, a;
  cin >> t;
  for (int i = 0; i < t; i += 1) {
    cin >> n >> x;
    vector<bool> place(300, false);
    for (int j = 0; j < n; j += 1) {
      cin >> a;
      place[a] = true;
    }
    for (int j = 1; j < 300; j++) {
      if (!place[j]) {
        x--;
        place[j] = true;
      }
      if (x == 0) {
        while (place[j]) j++;
        cout << j - 1 << endl;
        break;
      }
    }
  }
}
