#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(0);
  int m;
  cin >> m;
  while (m--) {
    int a, b;
    cin >> a >> b;
    long long c[202] = {0};
    for (long long int i = 0; i < a; i++) {
      int x;
      cin >> x;
      c[x] = 1;
    }
    int j = b, k = 1;
    while (j > 0) {
      if (c[k] == 0) {
        c[k] = 1;
        j--;
      }
      k++;
    }
    while (c[k] != 0) k++;
    cout << k - 1 << endl;
  }
  return 0;
}
