A string S of length L is given. For any string T, define c(T) as the largest number of occurrences of S inside T that do not overlap each other. The characters of S have to appear consecutively inside T.
For example, if S = "ab", then c("xyz") = 0 and c("ababxab") = 3. If S = "aaa", then c("aa") = 0 and c("aaaaaa") = 2.
Given two integers N and K, write a program that counts the strings X satisfying all three conditions below.
- X consists of lowercase letters only.
- The length of X is at least L×K and at most L×K+N.
- c(X) = K.
When K = 0, a string X of length 0 also satisfies the conditions. The empty string has c value 0, so it is included in the count.