// Arup Guha
// 11/26/2013
// Solution to 2013 Pacific Northwest Problem I: Interstellar Trade

// The key here is the observation that the 2 worm holes must be placed at the same distance
// from both end points. (If not, we can reduce one of the two max distances...) The final
// observation is that the minimum possible answer is simply the distance to the closest
// point to the middle. From there, we move our worm holes as far away from the ends as possible,
// without making the distance between end points maximal and check the farthest points on the "circle".
import java.util.*;

public class i {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=0; loop<numCases; loop++) {

			// Read in data, recenter so left end is 0.
			int n = stdin.nextInt();
			int[] array = new int[n];
			for (int i=0; i<n; i++)
				array[i] = stdin.nextInt();
			Arrays.sort(array);
			int offset = array[0];
			for (int i=0; i<n; i++)
				array[i] -=offset;

			// Find the closest point to the middle and how far either end is from it.
			int max = array[n-1];
			int far = 0, farI = 0;;
			for (int i=0; i<n; i++) {
				int cur = Math.min(array[i]-array[0],array[n-1]-array[i]);
				if (cur > far) {
					far = cur;
					farI = i;
				}
			}

			// Copy over circle values.
			ArrayList<Integer> circle = new ArrayList<Integer>();
			for (int i=0; i<n; i++)
				if (array[i] >= far/2.0 && array[i] <= array[n-1]-far/2.0)
					circle.add(array[i]);

			// Run around the circle, trying to maximize the distance between two points on the circle.
			int circumference = array[n-1] - far;
			int i = 0, j = 0, best = 0;
			while (i < circle.size() && j < circle.size()) {

				int cur = array[j] - array[i];
				if (Math.min(cur, circumference-cur) > best) best = Math.min(cur, circumference-cur);

				if (cur < circumference/2) j++;
				else i++;
			}

			// This is our answer.
			System.out.println(Math.max(far, best));
		}
	}
}