// Arup Guha
// 9/7/2013
// Solution to UCF JV Practice Problem I: Round Robin Tournament

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++) {

			int n = stdin.nextInt();
			int[] x = new int[n];
			int[] y = new int[n];

			// Read in all the locations, into separate arrays.
			for (int i=0; i<n; i++) {
				x[i] = stdin.nextInt();
				y[i] = stdin.nextInt();
			}

			// Sort so we can find the median of both lists.
			Arrays.sort(x);
			Arrays.sort(y);

			// We want to travel to the median of both coordinates.
			int myX = x[n/2];
			int myY = y[n/2];

			// Determine the minimum distance travelled.
			int sum = 0;
			for (int i=0; i<n; i++) {
				sum += Math.abs(myX-x[i]);
				sum += Math.abs(myY-y[i]);
			}

			// Output result.
			System.out.println(sum);
		}
	}
}