#c22301. 字符串匹配例题
字符串匹配例题
String Matching Example
Problem Description
You are given two strings and , consisting only of lowercase letters. Count how many times occurs as a substring in .
There are multiple test cases. The first line is the number of test cases . Each test case consists of two lines: the first line is string , the second line is string .
For each test case output two lines: the first line is the number of occurrences, and the second line lists the starting index (1-based, where the first character of has index 1) of each occurrence. If does not occur, output two lines each containing .
Input Format
The first line contains an integer .
The following lines each contain one string.
Output Format
Output lines, each containing several integers. See the description above.
Sample Input
3
abababa
aba
aaaaaa
bb
abcabcab
abcab
Sample Output
3
1 3 5
-1
-1
2
1 4
Constraints
For all data: , , and both strings consist only of lowercase letters.