#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  for (long long s = 0; s < t; s++) {
    long long summ = 0;
    long long n, k;
    cin >> n >> k;
    vector<bool> kran(n + 1);
    for (long long i = 0; i < k; i++) {
      long long a;
      cin >> a;
      kran[a] = 1;
    }
    for (long long i = 1; i <= n; i++) {
      long long maximum = 1e9;
      for (long long r = i; r > 0; r--) {
        if (kran[r]) maximum = min(maximum, i - r + 1);
      }
      for (long long r = i; r <= n; r++) {
        if (kran[r]) maximum = min(maximum, r - i + 1);
      }
      summ = max(summ, maximum);
    }
    cout << summ << endl;
  }
}
