In 2005, with the aim of promoting and encouraging the use of Catalan in the daily lives of Catalans, the Generalitat of Catalonia created a campaign called "Dóna corda al Català". This campaign had a mascot, Queta, which was a mouth with legs that, when wound up, would move forward by opening and closing its mouth.
Fifteen years later, the Generalitat no longer has space to store more materials from past campaigns, so they have decided to sell all the remaining Quetas they had to an English family that is involved in illegal betting.
They have created a game to make money from the bets. The game consists of the following:
A line is drawn on the ground, and two marks are made on this line. $$$n$$$ Quetas are placed on the line between the two marks, all in different positions, with each Queta facing one of the two marks. They are wound up and start running at the same speed. When two Quetas collide head-on, both are destroyed. The game ends when there are no Quetas left between the two marks. The objective of the game is to guess how many Quetas will remain at the end of the game.
Given the positions of the marks and the Quetas at the start of the game, determine how many Quetas will remain at the end.
The input begins with an integer $$$t$$$ indicating the number of cases.
Each case starts with an integer $$$n$$$ and two integers $$$m_1$$$ and $$$m_2$$$, with $$$m_1 \lt m_2$$$, indicating the two marks.
The second line contains $$$n$$$ integers $$$q_i$$$ with $$$m_1 \lt q_i \lt m_2$$$, indicating the initial positions of the Quetas.
The third line contains $$$n$$$ integers $$$d_i$$$, where if $$$d_i = 1$$$, the i-th Queta is pointing to mark 1, and if $$$d_i = 2$$$, it is pointing to mark 2.
For each case, write a line with the answer.
$$$1 \leq t \leq 100$$$
13 Points: All $$$d_i$$$ are the same.
24 Points: $$$1 \leq n \leq 100$$$, $$$1 \leq m_i \leq 200$$$
25 Points: $$$1 \leq n \leq 1000$$$, $$$1 \leq m_i \leq 2000$$$
26 Points: $$$1 \leq n \leq 10000$$$, $$$1 \leq m_i \leq 20000$$$
12 Points: $$$1 \leq n \leq 10000$$$, $$$1 \leq m_i \leq 10^9$$$
4 6 2 16 14 4 11 8 6 9 1 1 2 1 1 2 6 1 20 14 4 5 9 7 10 2 2 1 2 2 2 5 1 19 11 16 8 7 4 2 1 1 2 2 4 1 20 3 15 10 12 1 1 1 1
4 4 1 4
For the first case, initially, the positions of the Quetas are as follows:
After some time, the Quetas that were originally in positions 11 and 14 collide and are destroyed:
The remaining Quetas manage to reach the marks safe and sound.
| Name |
|---|


