#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, k, temp;
    cin >> n >> k;
    vector<int> v(n + 1, 0);
    vector<bool> isTap(n + 1, false);
    for (int i = 0; i < k; ++i) {
      cin >> temp;
      isTap[temp] = true;
      v[temp] = 1;
    }
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j)
        if (isTap[j]) {
          if (j - i > 0 && v[j - i] == 0) v[j - i] = v[j] + i;
          if (j + i <= n && v[j + i] == 0) v[j + i] = v[j] + i;
        }
    }
    cout << *max_element(next(v.begin(), 1), v.end()) << endl;
  }
}
