#include <bits/stdc++.h>
using namespace std;
int p[200001];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, h;
    scanf("%d %d", &h, &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &p[i]);
    }
    int cur = h;
    int cnt = 0;
    int i = 1;
    while (cur > 0 && i < n) {
      cur = p[i] + 1;
      if (cur <= 2) break;
      if (i == n - 1 || cur != p[i + 1] + 2) {
        cnt++;
        i++;
        cur -= 2;
      } else {
        i += 2;
        cur -= 2;
      }
    }
    printf("%d\n", cnt);
  }
}
