#include <bits/stdc++.h>
using namespace std;
struct nod {
  int x, step;
};
nod o;
int main() {
  bool v[201];
  int w, sum = 0;
  queue<nod> q;
  int n, t, k;
  cin >> t;
  for (int j = 0; j < t; j++) {
    sum = 0;
    memset(v, false, sizeof(v));
    cin >> n >> k;
    for (int i = 1; i <= k; i++) {
      cin >> w;
      q.push((nod){w, 1});
      v[w] = 1;
      sum++;
    }
    if (sum >= n) {
      cout << 1 << endl;
      while (!q.empty()) q.pop();
      continue;
    }
    while (!q.empty()) {
      o = q.front();
      q.pop();
      if (o.x + 1 <= n) {
        if (v[o.x + 1] != 1) {
          q.push((nod){o.x + 1, o.step + 1});
          v[o.x + 1] = 1;
          sum++;
        }
      }
      if (o.x - 1 > 0) {
        if (v[o.x - 1] != 1) {
          q.push((nod){o.x - 1, o.step + 1});
          v[o.x - 1] = 1;
          sum++;
        }
      }
      if (sum >= n) {
        cout << o.step + 1 << endl;
        break;
      }
    }
    while (!q.empty()) q.pop();
  }
}
