#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPerfectSquare(long long x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n == 2 || n == 3) return true;
  for (long long i = 2; i <= sqrt(n) + 1; i++)
    if (n % i == 0) return false;
  return true;
}
long long fact(long long n) {
  long long res = 1;
  for (long long i = 2; i <= n; i++) res = res * i;
  return res;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long i, j;
    long long cnt1 = 0, cnt2 = 0, sm = 0;
    long long mx = INT_MIN, mn = INT_MAX;
    long long temp = 1;
    long long flag = 0;
    long long s = 0;
    vector<long long> v;
    bool ok = false;
    long long n;
    long long x;
    cin >> n >> x;
    long long a[n + 1];
    for (i = 1; i <= n; i++) cin >> a[i];
    bool visited[205] = {false};
    for (i = 1; i <= n; i++) {
      visited[a[i]] = true;
    }
    for (i = 1; i <= 204; i++) {
      if (x > 0) {
        if (visited[i] == false) {
          visited[i] = true;
          x--;
        }
      }
    }
    for (i = 1; i <= 204; i++) {
      if (visited[i] == false) {
        cout << i - 1 << endl;
        break;
      }
    }
  }
  return 0;
}
