#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define IT(c) typeof((c).begin()) #define For(i, a, b) for(int (i) = int(a); i < int(b); ++i) #define rep(x, n) For(x,0,n) #define foreach(i, c) for(IT(c) i = (c).begin(); i != (c).end(); ++i) #define sz(a) int((a).size()) #define pb push_back #define mp make_pair #define F first #define S second typedef vector Vi; typedef vector > Vvi; typedef vector Vs; typedef pair Pi; struct Point{ double x,y; Point(double tx, double ty) : x(tx), y(ty) {} Point() {} Point perp() {return Point(-y, x);} Point add(Point p) {return Point(x+p.x, y+p.y);} Point sub(Point p) {return Point(x-p.x, y-p.y);} Point mult(double d) {return Point(x*d, y*d);} double dot(Point p) {return x*p.x + y*p.y;} double len() {return hypot(x,y);} Point scale(double d) {return mult(d/len());} Point rot(double theta) {return Point(x*cos(theta) - y*sin(theta), x*sin(theta) + y*cos(theta));} }; int main(){ int np; cin>>np; rep(tp,np){ int n; cin>>n; Point P[n+1]; rep(i,n) cin>>P[i].x>>P[i].y; P[n] = P[0].add(Point(0,1)); double res = 1e100; const double inf = 1e100; rep(i,n+1) rep(j,n+1) if(i != j){ if((P[i].sub(P[j])).len() < 1e-5) continue; Point v1 = P[i].sub(P[j]).scale(1.0); Point v2 = v1.perp(); double ax=inf, ay=inf, bx=-inf, by=-inf; rep(k,n){ double x = v1.dot(P[k]); double y = v2.dot(P[k]); ax = min(ax, x); bx = max(bx, x); ay = min(ay, y); by = max(by, y); } res = min(res, (bx - ax)*(by - ay)); } cout<