{"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":"In a Halloween video game, you need to overcome obstacles in order to collect candies. At this point in the game, you are required to come down an isolated tower. The tower has height h, and there is a moving platform on each height x from 1 to h.\nEach platform is either hidden inside the tower or moved out. At first, there are n moved out platforms on heights p1,p2,…,pn. The platform on height h is moved out (and at the beginning, you are standing there).\nIf you are standing on some moved out platform on height x, then you have the power to pull a special lever, which switches the state of two platforms: on height x and x−1. In other words, the platform you are currently standing on will hide inside the tower and the platform one unit below will change its 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. Note that this is the only way to move from one platform to another.\nBut in this video game, you are quite fragile, so you 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.\nSometimes it\u0027s not possible to come down from the tower, 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.\nWhat is the minimum number of magic crystals you need to buy to safely land on the 0 ground level?"}},{"title":"Input","value":{"format":"MD","content":"The first line contains one integer q (≤q≤100) — the number of queries. Each query contains two lines and is independent of all other queries.\nThe first line of each query contains two integers h and n (1≤h≤109, 1≤n≤min(h,2⋅105)) — the height of the tower and the number of moved out platforms.\nThe second line contains n integers p1,p2,…,pn (h\u003dp1\u003ep2\u003e⋯\u003epn≥1) — the corresponding moved out platforms in the descending order of their heights.\nThe sum of n over all queries does not exceed 2⋅105."}},{"title":"Output","value":{"format":"MD","content":"For 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)."}},{"title":"Example","value":{"format":"MD","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \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\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e0\n1\n2\n0\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}