#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897;
const int mod = 1000000007;
const int M = 100005;
int INF = INT_MAX;
int solve() {
  int n, x, i, c;
  cin >> n >> x;
  int a[300] = {0};
  for (i = 0; i < n; i++) {
    int second;
    cin >> second;
    a[second] = 1;
  }
  for (i = 1, c = 0; i <= n + x && c < x; i++) {
    if (!a[i]) {
      a[i] = 1;
      c++;
    }
  }
  for (i = 1; i <= n + x; i++)
    if (!a[i]) break;
  cout << i - 1 << "\n";
  return 0;
}
int main() {
  cin.sync_with_stdio(false);
  int t, i = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
