{"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":"HTML","content":"华生即将向福尔摩斯发信息。他有一个字符串s。\u003cp\u003e\n\n如果您可以从字符串s中的某个位置开始读取字符串p,则将其称为字符串s的子字符串。例如,字符串“ aba”具有六个子字符串:“a”,“b”,“ a”,“ab”,“ba”,“aba”。\u003cp\u003e\n\n华生计划采用字符串s并从中切出一些子字符串,我们称其为t。然后,他需要将子串t更改零次或多次。最终,他将获得一个固定的字符串u(这是应该发送给福尔摩斯的字符串)。\u003cp\u003e\u003cp\u003e\n\n一次更改定义为执行以下操作之一:\u003cp\u003e\n1. 在字符串的任何一端插入一个字母。\u003cp\u003e\n2. 从字符串的任何一端删除一个字母。\u003cp\u003e\n3. 将一个字母更改为其他任何字母。\u003cp\u003e\n华生很困扰,他希望在选择一些子串t之后,进行最少的更改以获得字符串u。\u003cp\u003e\n\n帮助华生从字符串s的所有子字符串中选择最佳的子字符串t。子字符串t应该能以最少的更改次数转换成字符串u。"}},{"title":"Input","value":{"format":"HTML","content":"第一行包含一个非空字符串s,由小写字母组成。\u003cp\u003e\n 第二行包含一个非空字符串u,由小写字母组成。 \u003cp\u003e\n两个字符串的长度都在1到2000(含)范围内。"}},{"title":"Output","value":{"format":"HTML","content":"打印一个整数-华生必须对选择的字符串t进行的最少更改。"}},{"title":"Examples","value":{"format":"HTML","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\u003eccccc\u003cbr\u003eccc\u003cbr\u003e\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\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003eqweqwe\u003cbr\u003ewed\u003cbr\u003e\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\u003e1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003ehijklm\u003cbr\u003eabcdefg\u003cbr\u003e\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\u003e7\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"在第一个示例中,华生可以采用任何长度为3的子字符串,并且它将等于所需的消息u,因此华生无需进行任何更改。\u003cp\u003e\n\n在第二个示例中,您应该采用由第二个到第四个(“weq”)或第五个到第六个(“ we”)字符组成的子字符串。 然后,您只需要进行一个更改即可:更改或添加最后一个字符。\u003cp\u003e\n\n在第三个示例中,初始字符串s不包含消息应包含的任何字符,因此,无论选择哪种字符串,您都必须进行至少7次更改才能获得所需的消息。"}}]}