In Dhaka, the mosquito population has risen to unprecedented levels this year. The threat of an epidemic outbreak of Dengue or Chikungunya feels more serious than ever. As dusk settles over the city, a relentless buzzing fills the air. Sleep is no longer peaceful; every night feels like a siege.
Trying to protect himself, Ishraque finds an old mosquito net. Though worn, it represents a vital barrier – a wall between him and the swarm of killers. However, even as he tucks it in, he wonders in fear: how many enemies are already inside the wall?
The upper structure of the net is defined by $$$n$$$ points $$$(ax_1, ay_1), (ax_2, ay_2), \dots, (ax_n, ay_n)$$$. The net is anchored to the bed at $$$(ax_1, 0)$$$ and $$$(ax_n, 0)$$$. The boundary forms a polygon consisting of straight line segments consisting of points $$$(ax_i, ay_i), (ax_{i+1}, ay_{i+1})$$$ for all $$$i$$$ such that $$$1 \le i \lt n$$$, vertical segments connecting the first and last points to their respective anchors on the bed and a horizontal segment along the bed from $$$(ax_1, 0)$$$ to $$$(ax_n, 0)$$$.
There are currently $$$m$$$ mosquitoes in his room located at points $$$(bx_1, by_1), (bx_2, by_2), \dots, (bx_m, by_m)$$$. Your task is to determine how many mosquitoes are inside the net or on its boundary.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases.
The first line of each test case contains two space-separated integers $$$n$$$ and $$$m$$$ ($$$2 \le n \le 2 \times 10^5$$$, $$$1 \le m \le 2 \times 10^5$$$) — the number of points describing the net and the number of mosquitoes.
The second line of each test case contains $$$n$$$ space-separated integers $$$ax_1, ax_2, \dots, ax_n$$$ ($$$0 \le ax_1 \lt ax_2 \lt \dots \lt ax_n \le 10^9$$$) — the $$$x$$$-coordinates of the net points.
The third line of each test case contains $$$n$$$ space-separated integers $$$ay_1, ay_2, \dots, ay_n$$$ ($$$ay_i \gt 0$$$ for any $$$i$$$ such that $$$1 \le i \le n$$$) — the $$$y$$$-coordinates of the net points.
The fourth line of each test case contains $$$m$$$ space-separated integers $$$bx_1, bx_2, \dots, bx_m$$$ ($$$0 \le bx_i \le 10^9$$$ for any $$$i$$$ such that $$$1 \le i \le n$$$) — the $$$x$$$-coordinates of the mosquitoes.
The fifth line of each test case contains $$$m$$$ space-separated integers $$$by_1, by_2, \dots, by_m$$$ ($$$0 \lt by_i \le 10^9$$$ for any $$$i$$$ such that $$$1 \le i \le n$$$) — the $$$y$$$-coordinates of the mosquitoes.
It is guaranteed that the sum of n over all test cases and the sum of m over all test cases do not exceed $$$2 \times 10^5$$$.
For each test case, output a single integer in a line — the number of mosquitoes that lie inside the net or on its boundary.
26 51 3 5 6 9 104 6 7 8 6 72 4 6 7 86 8 7 3 72 510 2010 107 12 15 17 205 12 8 10 9
23
The following is the illustration for the first test case:
| Name |
|---|


