{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n div.sampleinteractionread {\n width: 60%;\n margin: 3px 0px 3px 0px;\n }\n div.sampleinteractionread pre {\n margin: 1px 5px 1px 5px;\n border-radius: 5px;\n border: solid 1px rgba(255, 255, 255, 0.25);\n background-color: #cccccc;\n padding: 14px 13px;\n font-family: Courier, monospace;\n font-variant-ligatures: none;\n }\n div.sampleinteractionwrite {\n width: 60%;\n margin: 3px 0px 3px 0px;\n margin-left: auto;\n }\n div.sampleinteractionwrite pre {\n margin: 1px 5px 1px 5px;\n border-radius: 5px;\n border: solid 1px rgba(255, 255, 255, 0.25);\n background-color: #cccccc;\n padding: 14px 13px;\n font-family: Courier, monospace;\n font-variant-ligatures: none;\n }\n table.sample {\n width: 100%;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003eModan is playing a new action strategy game, where his goal\n is to destroy a city.\u003c/p\u003e\n\n \u003cp\u003eA city is made up of \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e buildings, where the \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e-th building initially has health\n \u003cspan class\u003d\"tex2jax_process\"\u003e$H_ i$\u003c/span\u003e. At every move,\n Modan can choose a building to attack, dealing \u003cspan class\u003d\"tex2jax_process\"\u003e$D$\u003c/span\u003e damage to it. When a building’s\n health falls below or equal to \u003cspan class\u003d\"tex2jax_process\"\u003e$0$\u003c/span\u003e, it is destroyed. When the\n \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e-th building gets\n destroyed, it explodes and deals \u003cspan class\u003d\"tex2jax_process\"\u003e$E_ i$\u003c/span\u003e damage to the adjacent\n buildings, i.e. the \u003cspan class\u003d\"tex2jax_process\"\u003e$i-1$\u003c/span\u003e-th and \u003cspan class\u003d\"tex2jax_process\"\u003e$i+1$\u003c/span\u003e-th buildings, if they exist.\u003c/p\u003e\n\n \u003cp\u003eModan is really addicted to the game and wants to know the\n minimum number of moves he needs to destroy a city.\u003c/p\u003e\n\n \u003ch2\u003eInput\u003c/h2\u003e\n\n \u003cp\u003eThe first line contains a single integer \u003cspan class\u003d\"tex2jax_process\"\u003e$T \\leq 100$\u003c/span\u003e giving the number of test\n cases. Each test case has three lines. On the first line, there\n are two integers \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e\n (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq N \\leq 10\\,\n 000$\u003c/span\u003e), the number of buildings, and \u003cspan class\u003d\"tex2jax_process\"\u003e$D$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1\n \\leq D \\leq 10^9$\u003c/span\u003e), the amount of damage Modan can do.\n On the second line, there are \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e integers, with the \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e-th integer being \u003cspan class\u003d\"tex2jax_process\"\u003e$H_ i$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq H_ i \\leq 10^9$\u003c/span\u003e), the initial\n health of the \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e-th\n building. On the third line, there are \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e integers, with the \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e-th integer being \u003cspan class\u003d\"tex2jax_process\"\u003e$E_ i$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\leq E_ i \\leq 10^9$\u003c/span\u003e), the amount\n of explosion damage the \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e-th building does.\u003c/p\u003e\n\n \u003ch2\u003eOutput\u003c/h2\u003e\n\n \u003cp\u003eFor each test case, output a single line containing the\n minimum number of moves needed to destroy the city.\u003c/p\u003e\n\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e2\n1 10\n33\n54\n3 10\n43 10 59\n69 69 69\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}