{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"The “repetitions” of a string S(whose length is n) is a maximum number “k” such that:\n\u003cbr\u003e\n 1) k is a factor of n\n\u003cbr\u003e\n 2) S[0..n/k-1] \u003d S[p*(n/k)..(p+1)*(n/k)-1] for all that (1 \u0026lt;\u003d p \u0026lt; n/k)\n\u003cbr\u003e\n for example:\n\u003cbr\u003e\n the repetitions of “aaaaaa”is 6.\n\u003cbr\u003e\n the repetitions of “abababab”is 4.\n\u003cbr\u003e\n the repetitions of “abcdef”is 1. \n\u003cbr\u003e\n Now, given a string S and a number K, please tell me how many substrings of S have repetitions NOT less than K.\n\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of several instances, each one for a single line.\n\u003cbr\u003e\n S K\n\u003cbr\u003e\n S is a string, K is a number. Check the Description for their meanings.\n\u003cbr\u003e\n S contains lowercase letters(ie \u0027a\u0027..\u0027z\u0027) only.\n\u003cbr\u003e\n 1 \u0026lt;\u003d length of S \u0026lt;\u003d 100000.\n\u003cbr\u003e\n 1 \u0026lt;\u003d K \u0026lt;\u003d length of S.\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each instance, output the number of substring whose repetitions is NOT less than K."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003eabcabc 2\r\nacmac 3\r\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\r\n0\r\n\u003c/pre\u003e"}}]}