#include <bits/stdc++.h>
bool flag = true;
using namespace std;
const double epsilon = 0.0000001f;
const double PI = 3.141592653589793238460;
const long long int cons = 2e5 + 1;
const long long int inf = 998244353;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int T = 1, te = 1;
  cin >> T;
  while (T--) {
    long long int i = 0, j = 0, ans = 0, x = 0, y = 0, z = 0;
    long long int n, k = 0, m = 0, mn = LLONG_MAX, mx = LLONG_MIN;
    cin >> k >> n;
    vector<long long int> a(n);
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long int h = k;
    i = 0;
    a.push_back(0);
    while (h > 2) {
      while (a[i] >= h) i++;
      if (i >= n) break;
      if (a[i] - a[i + 1] > 1) ans++;
      h = a[i] - 1;
    }
    cout << ans << endl;
  }
  return 0;
}
