{"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":"PLAIN","content":"帮帮同学忘记了他的作业帮密码,他有n个可能的密码,帮帮决定按照密码的长度从短到长一一验证,每次登录操作花费1秒,每错了k次,他都需要等待5秒之后才可以继续尝试。"}},{"title":"Input","value":{"format":"PLAIN","content":"第一行输入n和k(1\u003c\u003dn,k\u003c\u003d100),接下来的2~n+1行是n个可能的密码(长度不超过200个字符, 字母和数字组成),第n+2行是正确的密码。"}},{"title":"Output","value":{"format":"PLAIN","content":"输出两个数,第一个是帮帮成功登陆所需的最短时间,第二个是成功登陆所需的最长时间,用空格隔开。"}},{"title":"Examples","value":{"format":"PLAIN","content":"Input1\n5 2\ncba\nabc\nbb1\nabC\nABC\nabc\nOutput1\n1 15\n\nInput2\n4 100\n11\n22\n1\n2\n22\nOutput2\n3 4"}},{"title":"Note","value":{"format":"PLAIN","content":"第一个示例案例。因为所有的密码长度相同,两种情况分别是在第一次尝试和最后一次尝试输入正确的密码。如果他在第一次尝试的时候进入,他会花1秒。因此,在最好的情况下,答案是1秒。如果他在最后一次尝试时输入,他先输入4个错误的密码。他花2秒输入前2个密码,当他两次输入错误的密码时,他会等待5秒。然后再花2秒输入2个错误的密码,再等5秒,最后再花1秒输入正确的密码。总之,在最坏的情况下,他可以在15秒内成功登陆。\n\n第二个示例案例, 需要先输入所有长度为1的密码,花2秒。然后,在最好的情况下,他立即输入正确的密码,花费3秒,但在最坏的情况下,他将其他长度为2的错误密码都尝试一遍,总共花了4秒。"}}]}