#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
int a[N + 10], pre[N + 10], nxt[N + 10];
bool mrk[N + 10];
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(mrk, false, sizeof mrk);
    int n, k, ans = 1;
    cin >> n >> k;
    for (int i = 0; i < k; i++)
      cin >> a[i], a[i]--, mrk[a[i]] = true, pre[i] = max(a[i] - 1, 0),
                           nxt[i] = min(a[i] + 1, n - 1);
    bool mark = true;
    while (true) {
      for (int i = 0; i < n; i++)
        if (!mrk[i])
          break;
        else if (i == n - 1)
          mark = false;
      if (!mark) {
        cout << ans << endl;
        break;
      }
      ans++;
      for (int i = 0; i < k; i++) {
        mrk[nxt[i]] = mrk[pre[i]] = true, nxt[i] = min(nxt[i] + 1, n - 1),
        pre[i] = max(pre[i] - 1, 0);
      }
    }
  }
  return 0;
  return 0;
}
