public void solve() throws IOException {
    int t = nextInt();
    for (int i = 0; i < t; i++) {
      int n = nextInt();
      long[] p = new long[n];
      for (int x = 0; x < n; x++) {
        p[x] = nextLong();
      }
      Arrays.sort(p);
      long max = p[p.length - 1];
      long min = p[0];
      
      long maxmin = Long.MAX_VALUE;
      
      for (int x = 0; x < p.length - 1; x++) {
        long first = p[x] - min;
        long second = max - p[x + 1];
        long cand = Math.max(first, second);
        if (cand < maxmin) {
          maxmin = cand;
        }
      }
      
      System.out.println(maxmin);
    }
  }