PROGRAMMING:Count the number of substrings
KMP algorithm is used to find the number of occurrences of substring t in a string s. String matching ignores case. The string length does not exceed 1000.
For example, s = abcabcabcabcd ", t = abcab". It is considered that t appears twice in S.
Note: the next array value of pattern string t has been given in the title.
###Input format:
Enter the string s on the first line
On the second line, enter the string t
The third line gives the next array value of the string t. Including next [0] ~ next [t.length-1]
###Output format:
The number of times the first row of output string t appears in S.
Next, output the position sequence number (logical sequence number, counting from 1) of the string t in S.
###Input example:
Here is a set of inputs. For example:
```in
Abcabcabcd
abcab
-1 0 0 0 1
```
###Output example:
The corresponding output is given here. For example:
```out
two
one
four
```
answer:If there is no answer, please comment
For example, s = abcabcabcabcd ", t = abcab". It is considered that t appears twice in S.
Note: the next array value of pattern string t has been given in the title.
###Input format:
Enter the string s on the first line
On the second line, enter the string t
The third line gives the next array value of the string t. Including next [0] ~ next [t.length-1]
###Output format:
The number of times the first row of output string t appears in S.
Next, output the position sequence number (logical sequence number, counting from 1) of the string t in S.
###Input example:
Here is a set of inputs. For example:
```in
Abcabcabcd
abcab
-1 0 0 0 1
```
###Output example:
The corresponding output is given here. For example:
```out
two
one
four
```
answer:If there is no answer, please comment