#include <bits/stdc++.h>
using namespace std;
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
int main() {
  long long t, n, k, arr[505], x, i;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    memset(arr, 0, sizeof arr);
    for (i = 1; i <= n; i++) {
      cin >> x;
      arr[x] = 1;
    }
    for (i = 1; k; i++)
      if (arr[i] == 0) arr[i] = 1, k--;
    for (i = 1; i < 500; i++)
      if (arr[i] == 0) break;
    cout << i - 1 << endl;
  }
  return 0;
}
