For each test case, compute the area inside a rectangle from which three given points are seen in a fixed clockwise order.
Medium5GeometryMathNo attempts yetTime limit1sMemory limit256 MBTorres del Paine National Park lies at the southern end of Patagonia. Granite peaks, glaciers, lakes and forest run together there, and a large number of people visit every year.

Three sheer granite peaks stand side by side in the middle of the park. They reach 2,800 m, and their names are Torre Norte (the north peak), Torre Central (the central peak) and Torre Sur (the south peak). The three peaks do not sit on one straight line, so the order in which you see them changes with where you stand.
The park is a rectangular region, and the three peaks A, B and C are points inside it. Take a point P in the park. Start from the direction of A as seen from P and turn clockwise all the way around. If you meet B before C, say that the three peaks are seen in order from P. Given the park region and the coordinates of the three peaks, compute the area of the set of points from which the three peaks are seen in order.
The points where two peaks overlap exactly as seen from P form a set of zero area, so they do not change the answer.
The first line contains the number of test cases T. (1≤T≤300)
Each test case takes two lines. The first line contains four integers x0, y0, x1, y1 describing the park region. The park is the rectangle whose lower left corner is (x0,y0) and whose upper right corner is (x1,y1). (−104≤x0<x1≤104, −104≤y0<y1≤104)
The second line contains six integers xa, ya, xb, yb, xc, yc, the coordinates of the three peaks A, B and C. All three points lie inside the park, that is, x0<xa,xb,xc<x1 and y0<ya,yb,yc<y1. No input has the three points on one straight line.
For each test case, print on one line the area of the region from which the three peaks are seen in order. Round the area at the seventh digit after the decimal point and print six digits after the decimal point. Print all six digits even when the answer is an integer.