{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"Given two strings a and b we define a*b to be their concatenation. For example, if a \u003d \"abc\" and b \u003d \"def\" then a*b \u003d \"abcdef\". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 \u003d \"\" (the empty string) and a^(n+1) \u003d a*(a^n).\n\u003chr/\u003e\n假设字符串 $s$ 可以由字符串 $t$ 重复 $n$ 次得到,即 $s\u003dttttt...t$(共 $n$ 个 $t$),则可以表示为 $s\u003dt^n$。\n给定字符串 $s$,问对于任意满足条件的字符串 $t$,能得到的 $n$ 的最大值是多少?"}},{"title":"Input","value":{"format":"HTML","content":"Each test case is a line of input representing s, a string of printable characters. The length of s will be at least 1 and will not exceed 1 million characters. A line containing a period follows the last test case.\n\u003chr/\u003e\n每组数据占一行,行内最多包含 $1000000$ 个字符。\n\u003cbr/\u003e\n数据以单点 \u0027.\u0027 作为结尾。"}},{"title":"Output","value":{"format":"HTML","content":"For each s you should print the largest n such that s \u003d a^n for some string a. \n\u003chr/\u003e\n输出所能得到的最大的 $n$。"}},{"title":"Sample","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\u003eabcd\naaaa\nababab\n.\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n4\n3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"This problem has huge input, use scanf instead of cin to avoid time limit exceed."}}]}