#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  int q, n, h, p, x;
  cin >> q;
  while (q--) {
    mp.clear();
    cin >> h >> n;
    cin >> p;
    n--;
    int ans = 0, cnt = 0;
    while (n--) {
      cin >> x;
      if (x >= 2) {
        if (mp[x + 1])
          mp[x] = mp[x + 1] + 1, cnt = mp[x];
        else {
          ans += (cnt & 1);
          mp[x] = 1;
          cnt = 1;
        }
      } else
        mp[x] = 1;
    }
    ans += (cnt & 1);
    if (mp[2] % 2) {
      if (mp[1] == 1) ans--;
    }
    cout << ans << "\n";
  }
  return 0;
}
