#include <bits/stdc++.h>
using namespace std;
long long a[1000005];
set<int> initial;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T, n, h;
  for (cin >> T; T--;) {
    initial.clear();
    cin >> h >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
      initial.insert(a[i]);
    }
    initial.insert(0);
    a[n + 1] = a[n + 2] = 0;
    int ans = 0, pos = h;
    for (; pos > 2;) {
      if (!initial.count(pos - 1)) {
        pos = *--initial.upper_bound(pos - 1) + 1;
      } else if (initial.count(pos - 2)) {
        pos = pos - 2;
      } else {
        ++ans;
        pos -= 2;
      }
    }
    cout << ans << '\n';
  }
}
