#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int mp[300];
  while (t--) {
    int n, m;
    cin >> n >> m;
    memset(mp, 0, sizeof(mp));
    int a;
    for (int i = 0; i < n; i++) {
      cin >> a;
      if (a < 300) mp[a] = 1;
    }
    int i = 1;
    for (i = 1; i <= 200; i++) {
      if (mp[i] == 1) continue;
      if (mp[i] == 0 && m) {
        m--;
        continue;
      } else
        break;
    }
    cout << i - 1 << endl;
  }
}
