#include <bits/stdc++.h>
using lli = long long int;
using namespace std;
const unsigned int M = 1000000007;
int main() {
  lli t, n, x, input;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    bool a[202];
    for (int i = 0; i <= 202; i++) a[i] = false;
    for (lli i = 0; i < n; i++) {
      cin >> input;
      a[input] = true;
    }
    for (int i = 1; i < 202; i++) {
      if (a[i] == true) continue;
      if (a[i] == false && x) {
        a[i] = true;
        x--;
      } else
        break;
    }
    for (int i = 1; i < 202; i++) {
      if (a[i] == false) {
        cout << i - 1 << "\n";
        break;
      }
    }
  }
  return 0;
}
