#include <bits/stdc++.h>
using namespace std;
vector<int> p;
int crystal = 0;
void showVec(vector<int> v) {
  for (auto& i : v) {
    cout << i << " ";
  }
  cout << endl;
}
vector<int> deltaVec(vector<int>& v) {
  vector<int> n;
  for (int i = 0; i < v.size() - 1; i++) n.push_back(v[i] - v[i + 1]);
  return n;
}
int main() {
  ios_base::sync_with_stdio(false);
  int q;
  cin >> q;
  int h, n, buf;
  for (int ii = 0; ii < q; ii++) {
    int ans = 0;
    cin >> h >> n;
    p = vector<int>(0);
    for (int jj = 0; jj < n; jj++) {
      cin >> buf;
      p.push_back(buf);
    }
    p.push_back(0);
    p.push_back(0);
    for (int i = 0; i < n; i++) {
      if (p[i + 1] - p[i + 2] > 1) {
        ans++;
      } else {
        i++;
      }
    }
    cout << ans << endl;
  }
}
