{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003eMohsen has a company, and he wants to hire \u003cb\u003eat least two\u003c/b\u003e new engineers. \u003c/p\u003e\n \u003cp\u003eHe- for some reason -wants the new engineers to be with the exact same experience. \u003c/p\u003e\n \u003cp\u003eYou are a new HR employee in Mohsen\u0027s company, you found out that the previous HR employee was working with a really weird method. \u003c/p\u003e\n\u003cp\u003e He collects all the skills of job applicants and represents every single skill with a character and rearranges all of them in a single string such a way that every sub-string represents the skill set of one applicant. \u003c/p\u003e\n\u003cp\u003eAs you know, Mohsen wants the new engineers to be as experienced as possible,so.\u003cp\u003e\n\u003cp\u003eGiven is a string S of length N Find the maximum length \u003cvar\u003e\\(len\\)\u003c/var\u003e of a skill set that occurs twice or more in S as contiguous substrings without overlapping.\u003cp\u003e\n \n \u003cp\u003eIf there is no such integer \u003cvar\u003e\\(len\\)\u003c/var\u003e, print \u003cvar\u003e\\(0\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cul\u003e\n \u003cli\u003e\u003cvar\u003e\\(2 \\leq N \\leq 5 \\times 10^3\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(|S| \u003d N\\)\u003c/var\u003e\u003c/li\u003e\n \u003cli\u003e\u003cvar\u003e\\(S\\)\u003c/var\u003e consists of lowercase English letters.\u003c/li\u003e\n \u003c/ul\u003e\n\u003c/section\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\n \u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\n\u003cvar\u003e\\(S\\)\u003c/var\u003e\n\u003c/pre\u003e\n\u003c/section\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003csection\u003e\n \u003cp\u003ePrint the maximum length of a skill set that occurs twice or more in \u003cvar\u003e\\(S\\)\u003c/var\u003e as contiguous substrings without overlapping. If there is no such non-empty string, print \u003cvar\u003e\\(0\\)\u003c/var\u003e instead.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\nababa\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\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eThe strings satisfying the conditions are: \u003ccode\u003ea\u003c/code\u003e, \u003ccode\u003eb\u003c/code\u003e, \u003ccode\u003eab\u003c/code\u003e, and \u003ccode\u003eba\u003c/code\u003e. The maximum length among them is \u003cvar\u003e\\(2\\)\u003c/var\u003e, which is the answer. Note that \u003ccode\u003eaba\u003c/code\u003e occurs twice in \u003cvar\u003e\\(S\\)\u003c/var\u003e as contiguous substrings, but there is no pair of integers \u003cvar\u003e\\(l_1\\)\u003c/var\u003e and \u003cvar\u003e\\(l_2\\)\u003c/var\u003e mentioned in the statement such that \u003cvar\u003e\\(l_1 + len \\leq l_2\\)\u003c/var\u003e.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\nxy\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n \u003cp\u003eNo non-empty string satisfies the conditions.\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e13\nstrangeorange\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e\n\u003c/section\u003e\u003csection\u003e\n\u003c/section\u003e"}}]}