#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<int> v;
    for (int i = 1; i <= n; i++) {
      int y;
      cin >> y;
      v.push_back(y);
    }
    int ans = 0;
    for (int i = 0; i <= 200; i++) {
      int keep = i;
      set<int> s;
      for (int j = 0; j < v.size(); j++) {
        if (v[j] <= keep) s.insert(v[j]);
      }
      int peek = s.size();
      if (peek + x >= keep) {
        ans = keep;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
