#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    int n, x;
    cin >> n >> x;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    int dp[202] = {0};
    for (int i = 0; i < 202; ++i) {
      dp[i] = 0;
    }
    int ans = 0, fans = 0;
    ;
    for (int i = 0; i < n; ++i) {
      dp[arr[i]]++;
      int nz = x;
      int j;
      for (j = 1; j < 202 && nz >= 0; ++j) {
        if (dp[j] == 0) nz--;
        ans = j;
      }
      if (nz < 0) {
        ans--;
      }
      fans = max(fans, ans);
    }
    cout << fans << "\n";
  }
  return 0;
}
