A polygon $P_1$ contains polygon $P_2$ if every point in or on $P_2$ is also in or on $P_1$. A polygon $P_1$ strictly contains $P_2$ if every point in or on $P_2$ is strictly inside $P_1$ (no point on the boundary).
Panda has two convex polygons, $P$ and $Q$. Polygon $P$ has $n$ vertices, and polygon $Q$ has $m$ vertices. It is guaranteed that $Q$ is strictly contained by $P$.
You should help Panda find the total number of ways to choose exactly $3$ distinct vertices from polygon $P$ that form a triangle $P_\Delta$ such that $P_\Delta$ (not strictly) contains polygon $Q$.

Input
The first line contains a single integer $T$ ($1 \le T \le 1000$), denoting the number of test cases.
For each test case, the first line contains an integer $n$ ($3 \le n \le 3 \cdot 10^5$), denoting the number of vertices of $P$.
For the next $n$ lines, each line contains two integers $x, y$ ($|x|, |y| \le 10^9$), denoting the coordinates of the vertices of $P$. It is guaranteed that the vertices are given in counter-clockwise order, and no three vertices are collinear.
The next line contains an integer $m$ ($3 \le m \le 3 \cdot 10^5$), denoting the number of vertices of $Q$.
For the next $m$ lines, each line contains two integers $x, y$ ($|x|, |y| \le 10^9$), denoting the coordinates of the vertices of $Q$. It is guaranteed that the vertices are given in counter-clockwise order, and no three vertices are collinear, and $Q$ is strictly contained by $P$.
It is guaranteed that both $\sum n$ and $\sum m$ over all test cases do not exceed $5 \cdot 10^5$.
Output
For each test case, output an integer in a single line, denoting the answer.
Examples
Input 1
3 6 -5 0 -4 -4 0 -4 3 1 2 5 -3 4 4 -2 1 -2 0 0 0 0 1 6 -5 0 -4 -4 0 -4 3 1 2 5 -3 4 4 -1 1 -1 0 0 0 0 1 7 1 -3 4 -1 5 0 1 4 0 4 -1 0 0 -2 3 0 0 2 0 0 2
Output 1
2 4 6
Note
For the first example, as shown in the figure, the polygon $P$ is $ABCDEF$, and the polygon $Q$ is $GHIJ$. The triangles $\triangle ACE$ and $\triangle BDF$ are the ones that contain $Q$.