{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"有N(1\u003c\u003dN\u003c\u003d20000)个音符的序列来表示一首乐曲,每个音符都是1..88范围内的整数,现在要找一个重复的子串,它需要满足如下条件:1.长度至少为5个音符。\n\n2.在乐曲中重复出现(就是出现过至少两次)。(可能经过转调,“转调”的意思是主题序列中每个音符都被加上或减去了同一个整数值) \n\n3.重复出现的同一主题不能有公共部分。"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The input contains several test cases. The first line of each test case contains the integer N. The following n integers represent the sequence of notes. \n \u003cbr\u003eThe last test case is followed by one zero. \n \u003cbr\u003e\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n For each test case, the output file should contain a single line with a single integer that represents the length of the longest theme. If there are no themes, output 0. \n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e30\n25 27 30 34 39 45 52 60 69 79 69 60 52 45 39 34 30 26 22 18\n82 78 74 70 66 67 64 60 65 80\n0\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e5\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Use scanf instead of cin to reduce the read time.\n \u003c/div\u003e"}}]}