{"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"有一个高度为h(1\u003c\u003dh\u003c\u003d1e9)的悬崖,从1到h有h个平台,其中n个平台被选中(n\u003c\u003dh且n\u003c\u003d2e5),每个平台只有被选中才能站上去。要从h高度到0高度(地面),每次只能这样下降:站在x,将x变成未选中,将x-1的状态取反。但是,这样你会一直掉,直到有一个高度上有平台。掉下去的高度差必须\u003c\u003d2个高度,要不然就死了。用一次魔法可以改变任意一个高度上平台的状态。请问最少需要多少次魔法才能活着到地面。"}},{"title":"Input","value":{"format":"MD","content":"第一行一个t(t\u003c\u003d100),表示有t组数据。\n\n对于每组数据,第一行有两个正整数h,n。(h \u003c\u003d 1e9, n \u003c\u003d min(h, 2e5) )。\n\n接下来一行有n个正整数,从高到低表示被选中的平台的高度。\n\n所有的n之和不大于2e5。"}},{"title":"Output","value":{"format":"MD","content":"输出t行。对于每组数据,输出最少需要用多少次魔法。"}},{"title":"Example","value":{"format":"MD","content":"### Input\n4\n3 2\n3 1\n8 6\n8 7 6 5 3 2\n9 6\n9 8 5 4 3 1\n1 1\n1\n\n### Output\n0\n1\n2\n0"}},{"title":"hint","value":{"format":"MD","content":"1e9 为 1000000000\n\n2e5 为 200000"}}]}