NC22396. Omnipotent ... Garland
描述
输入描述
The first line contains an integer, the number of test cases. Then T test cases follow.
The input format of each test case is as follows:
The first line contains three integers, the length of the garland, the number of sub-garlands and the factor of sub-garlands' lengths.
The second line contains a string t of length n, where the i-th character is either ``B'' or ``C'', representing, the type of the flower i.
It is guaranteed that the sum of n in all test cases is at most.
输出描述
Answer each test case in order. For each test case, the output format is as follows:
The first line contains a string ``Yes'' or ``No'' (without the quotation marks). Output ``Yes'' if there exists a valid partition, or ``No'' otherwise.
If the answer is ``Yes'', output the sub-garlands in the following m lines. In each line, the first integer is the length of that sub-garland. The following
integers are the indices in the original garland of the flowers in it, in ascending order.
示例1
输入:
4 6 2 2 BBCCBB 6 2 3 BBCCBB 4 4 1 BBBB 12 2 3 BBCCBCCBBCCC
输出:
Yes 2 0 1 4 2 3 4 5 Yes 3 0 1 2 3 3 4 5 No Yes 6 0 1 2 3 5 6 6 4 7 8 9 10 11