{"trustable":true,"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":"HTML","content":"\u003cp\u003eYou are playing a game where your character should overcome different obstacles. The current problem is to come down from a cliff. The cliff has height $$$h$$$, and there is a moving platform on each height $$$x$$$ from $$$1$$$ to $$$h$$$.\u003c/p\u003e\u003cp\u003eEach platform is either hidden inside the cliff or moved out. At first, there are $$$n$$$ moved out platforms on heights $$$p_1, p_2, \\dots, p_n$$$. The platform on height $$$h$$$ is moved out (and the character is initially standing there).\u003c/p\u003e\u003cp\u003eIf you character is standing on some moved out platform on height $$$x$$$, then he can pull a special lever, which switches the state of \u003cspan class\u003d\"tex-font-style-bf\"\u003etwo platforms: on height $$$x$$$ and $$$x - 1$$$\u003c/span\u003e. In other words, the platform you are currently standing on will hide in the cliff and the platform one unit below will change it state: it will hide if it was moved out or move out if it was hidden. In the second case, you will safely land on it. \u003cspan class\u003d\"tex-font-style-bf\"\u003eNote that this is the only way to move from one platform to another\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eYour character is quite fragile, so it can safely fall from the height no more than $$$2$$$. In other words falling from the platform $$$x$$$ to platform $$$x - 2$$$ is okay, but falling from $$$x$$$ to $$$x - 3$$$ (or lower) is certain death. \u003c/p\u003e\u003cp\u003eSometimes it\u0027s not possible to come down from the cliff, but you can always buy (for donate currency) several magic crystals. Each magic crystal can be used to change the state of any single platform (except platform on height $$$h$$$, which is unaffected by the crystals). After being used, the crystal disappears.\u003c/p\u003e\u003cp\u003eWhat is the minimum number of magic crystal you need to buy to safely land on the $$$0$$$ ground level?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains one integer $$$q$$$ ($$$1 \\le q \\le 100$$$) — the number of queries. Each query contains two lines and is independent of all other queries.\u003c/p\u003e\u003cp\u003eThe first line of each query contains two integers $$$h$$$ and $$$n$$$ ($$$1 \\le h \\le 10^9$$$, $$$1 \\le n \\le \\min(h, 2 \\cdot 10^5)$$$) — the height of the cliff and the number of moved out platforms.\u003c/p\u003e\u003cp\u003eThe second line contains $$$n$$$ integers $$$p_1, p_2, \\dots, p_n$$$ ($$$h \u003d p_1 \u0026gt; p_2 \u0026gt; \\dots \u0026gt; p_n \\ge 1$$$) — the corresponding moved out platforms in the descending order of their heights.\u003c/p\u003e\u003cp\u003eThe sum of $$$n$$$ over all queries does not exceed $$$2 \\cdot 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each query print one integer — the minimum number of magic crystals you have to spend to safely come down on the ground level (with height $$$0$$$).\u003c/p\u003e"}},{"title":"Examples","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\u003e4\n3 2\n3 1\n8 6\n8 7 6 5 3 2\n9 6\n9 8 5 4 3 1\n1 1\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n1\n2\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}