#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, x;
  int cont[200];
  cin >> t;
  while (t--) {
    cin >> n >> x;
    for (int i = 1; i <= n + x; i++) cont[i] = 0;
    for (int i = 1; i <= n; i++) {
      int pos;
      cin >> pos;
      cont[pos] = 1;
    }
    for (int j = n + x; j > 0; j--) {
      int max = 0;
      for (int i = 1; i <= j; i++) {
        if (cont[i] != 1) max++;
      }
      if (max <= x) {
        cout << j << endl;
        break;
      }
    }
  }
  return 0;
}
