{"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":"\u003cdiv style\u003d\"width:25.00%\" class\u003d\"illustration\"\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/3e3165d43b95040f6870bd060920b24d?v\u003d1715481715\" alt\u003d\"/problems/climbingworm/file/statement/en/img-0001.png\" class\u003d\"illustration\"\u003e\n \n \u003c/div\u003e\n \u003cp\u003e一只虫子位于杆的底部。它想要到达顶部,但它太懒了,不能一直爬到顶部而不停下来。它可以一次爬上杆的一定英寸,然后在休息时下降较少的英寸。为了到达杆的顶部,虫子需要爬几次?\u003c/p\u003e\n \u003ch2\u003e输入\u003c/h2\u003e\n \u003cp\u003e输入由一行组成,包含三个整数\u003cspan class\u003d\"tex2jax_process\"\u003e$a, b$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\leq b \u0026lt; a \\leq\n 100$\u003c/span\u003e)和\u003cspan class\u003d\"tex2jax_process\"\u003e$h$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0 \u0026lt; h \\leq 100\\,\n 000$\u003c/span\u003e),分别表示虫子一次可以爬升的英寸数\u003cspan class\u003d\"tex2jax_process\"\u003e$a$\u003c/span\u003e,虫子休息期间下降的英寸数\u003cspan class\u003d\"tex2jax_process\"\u003e$b$\u003c/span\u003e,以及杆的高度\u003cspan class\u003d\"tex2jax_process\"\u003e$h$\u003c/span\u003e。对于这个问题,虫子被建模为一个点,因此没有长度。\u003c/p\u003e\n \u003ch2\u003e输出\u003c/h2\u003e\n \u003cp\u003e输出虫子必须爬多少次才能到达杆的顶部。\u003c/p\u003e\n \u003ch2\u003e示例 1\u003c/h2\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\u003e5 0 15\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n \u003ch2\u003e示例 2\u003c/h2\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\u003e3 1 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}