Traffic Volume

No attempts yetTime limit1sMemory limit256 MB

Problem

Seungmin measures the traffic on the Mapo Bridge. He hung two strings across the road, parallel and a fixed distance apart. Every time a car wheel rolls over a string, a small box at the end of that string records the time. Records from the left string go into the left box, records from the right string go into the right box.

One car coming from the left leaves four records.

  • time tt, when the front wheels cross the left string
  • time t+500t + 500, when the rear wheels cross the left string
  • time t+1000t + 1000, when the front wheels cross the right string
  • time t+1500t + 1500, when the rear wheels cross the right string

A car coming from the right follows the same rule with left and right swapped. The right box gets tt and t+500t + 500, the left box gets t+1000t + 1000 and t+1500t + 1500.

At most one car is on a string at any moment. Given the recorded times in the two boxes, find how many cars came from the left.

Input

The first line has the number of test cases nn (1n1001 \le n \le 100).

The first line of each test case has mm (0m2000 \le m \le 200), the number of times recorded in one box. Each car leaves two records in each box, so mm is even. The second line has the mm times from the left box, and the third line has the mm times from the right box. Every time is a non-negative integer smaller than 10910^9, and the times come in no particular order. When m=0m = 0, both lines are empty.

The input can always be explained by a set of cars that obey the rules above.

Output

For each test case, print the number of cars that came from the left, one per line.