#include <bits/stdc++.h>
using namespace std;
const long long MX = 2e5 + 200, D = 1e9 + 7;
long long mat[MX];
bool big(long long a, long long b) { return a > b; }
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    long long n, h;
    cin >> h >> n;
    for (long long i = 0; i < n; i++) cin >> mat[i];
    sort(mat, mat + n, big);
    long long p = 1;
    long long ans = 0;
    while (p < n - 1) {
      if (mat[p] - mat[p + 1] == 1) {
        p += 2;
      } else {
        ans++;
        p++;
      }
    }
    if (p == n)
      cout << ans << endl;
    else {
      cout << ans + (mat[p] > 1) << endl;
    }
  }
  return 0;
}
