// Arup Guha
// 10/14/2015
// Solution to 2000 UCF HS Contest Problem: Bounding Rects

import java.util.*;

public class rect {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numPoly = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=numPoly; loop++) {

			// Read in first vertex - setting min and max.
			int n = stdin.nextInt();
			int x = stdin.nextInt();
			int y = stdin.nextInt();
			int maxx = x, minx = x;
			int maxy = y, miny = y;

			// Read in rest - just storing min and max for x and y.
			for (int i=0; i<n-1; i++) {
				x = stdin.nextInt();
				y = stdin.nextInt();
				maxx = Math.max(maxx, x);
				minx = Math.min(minx, x);
				maxy = Math.max(maxy, y);
				miny = Math.min(miny, y);
			}

			// Calculate area and output.
			int area = (maxx-minx)*(maxy-miny);
			System.out.println("The bounding rect of polygon "+loop+" has area "+area+".");
		}
	}
}

