#include <bits/stdc++.h>
using namespace std;
#pragma G++ optimize(2)
#pragma G++ optimize(3)
int main() {
  int t;
  cin >> t;
  int a[100009];
  int b[200];
  while (t--) {
    int n, x;
    cin >> n >> x;
    int i;
    for (i = 1; i < 200; i++) b[i] = 0;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      b[a[i]] = 1;
    }
    for (i = 1; i < 200; i++) {
      if (b[i] != 1) {
        x--;
      }
      if (x == 0) {
        if (b[i + 1] == 1) continue;
        break;
      }
    }
    cout << i << endl;
  }
}
