{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\n你正在玩一款类似于无限数轴上的《推盒子》游戏。这个博弈是离散的,所以你只考虑直线上的整数位置.\u003c/p\u003e\n你开始站在0位置上。有n个盒子,第i个盒子在a_i的位置上。盒子的所有位置都是不同的。还有m个特殊位置,第j个位置是b_ j。所有的特殊位置也都是不同的。\u003c/p\u003e\n\u003cp\u003e在一次移动中,你可以向左或向右移动一个位置。如果在你移动的方向上有一个盒子,那么你就把盒子推到那个方向的下一个位置。如果下一个位置被另一个盒子占据,那么这个盒子也会被推到下一个位置,依此类推。你不能穿过这些箱子。你不能把箱子拉向你\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003e你可以执行任意数量的移动(可能是零)。你的目标是把尽可能多的盒子放在特殊的位置上。请注意,有些盒子最初可以放置在特殊位置上。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数 $$$t$$$ ($$$1 \\le t \\le 1000$$$)\u0026nbsp;— 测试用例的数量.\u003c/p\u003e\n\u003cp\u003e然后对t个测试用例进行描述.\u003c/p\u003e\n\u003cp\u003e每个测试用例的第一行包含两个整数n和m ($$$1 \\le n, m \\le 2 \\cdot 10^5$$$)\u0026nbsp;— 分别为盒子的数量和特殊位置的数量.\u003c/p\u003e\n\u003cp\u003e每个测试用例的第二行按递增顺序包含n个不同的整数 $$$a_1, a_2, \\dots, a_n$$$ ($$$-10^9 \\le a_1 \u0026lt; a_2 \u0026lt; \\dots \u0026lt; a_n \\le 10^9$$$; $$$a_i \\neq 0$$$)\u0026nbsp;— 盒子的初始位置.\u003c/p\u003e\n\u003cp\u003e每个测试用例的第三行按递增顺序包含m个不同的整数$$$b_1, b_2, \\dots, b_m$$$ ($$$-10^9 \\le b_1 \u0026lt; b_2 \u0026lt; \\dots \u0026lt; b_m \\le 10^9$$$; $$$b_i \\neq 0$$$)\u0026nbsp;— 特殊位置.\u003c/p\u003e\n\u003cp\u003e对所有测试用例n的和不会超过 $$$2 \\cdot 10^5$$$. 对所有测试用例m的和不会超过 $$$2 \\cdot 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"对于每个测试用例,打印一个整数——可以放在特殊位置上的盒子的最大数量。"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n5 6\n-1 1 5 11 15\n-4 -3 -2 6 7 15\n2 2\n-1 1\n-1000000000 1000000000\n2 2\n-1000000000 1000000000\n-1 1\n3 5\n-1 1 2\n-2 -1 1 2 5\n2 1\n1 2\n10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n2\n0\n3\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first testcase you can go $$$5$$$ to the right: the box on position $$$1$$$ gets pushed to position $$$6$$$ and the box on position $$$5$$$ gets pushed to position $$$7$$$. Then you can go $$$6$$$ to the left to end up on position $$$-1$$$ and push a box to $$$-2$$$. At the end, the boxes are on positions $$$[-2, 6, 7, 11, 15]$$$, respectively. Among them positions $$$[-2, 6, 7, 15]$$$ are special, thus, the answer is $$$4$$$.\u003c/p\u003e\n\u003cp\u003eIn the second testcase you can push the box from $$$-1$$$ to $$$-10^9$$$, then the box from $$$1$$$ to $$$10^9$$$ and obtain the answer $$$2$$$.\u003c/p\u003e\n\u003cp\u003eThe third testcase showcases that you are not allowed to pull the boxes, thus, you can\u0027t bring them closer to special positions.\u003c/p\u003e\n\u003cp\u003eIn the fourth testcase all the boxes are already on special positions, so you can do nothing and still obtain the answer $$$3$$$.\u003c/p\u003e\n\u003cp\u003eIn the fifth testcase there are fewer special positions than boxes. You can move either $$$8$$$ or $$$9$$$ to the right to have some box on position $$$10$$$.\u003c/p\u003e"}}]}