#include <bits/stdc++.h>
int main() {
  int t, n, x, i, k;
  scanf("%d", &t);
  for (i = 1; i <= t; i = i + 1) {
    scanf("%d %d", &n, &x);
    int a[n], j, p, sum = 0, v = 0, q, num = 0, m;
    for (j = 0; j < n; j = j + 1) {
      scanf("%d", &a[j]);
    }
    q = x;
    for (j = 1; j != 0; j = j + 1) {
      int b = 0;
      for (k = 0; k < n; k = k + 1) {
        if (a[k] == j) {
          sum = sum + 1;
          b = 1;
          break;
        }
      }
      if (b == 0) {
        x = x - 1;
      }
      if (x == 0) {
        break;
      }
    }
    p = sum + q;
    for (k = j + 1; k != 0; k = k + 1) {
      v = 0;
      for (m = 0; m < n; m = m + 1) {
        if (k == a[m]) {
          v = 1;
          num = num + 1;
          break;
        }
      }
      if (v == 0) {
        break;
      }
    }
    printf("%d\n", p + num);
  }
}
