Omnipotent Garland

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Rikka finally fell asleep on the top of the lunar tower. She dreamed about LCR's unique garland which she had always treated with great interest. The garland is made of nn flowers of two types: Bauhinia Blakeana and Cerasus Yedoensis. For convenience, we use abbreviations to call them "B" and "C". The nn flowers form a ring, that is, each flower has an integer index in \[0,n)\[0, n) such that the flowers ii and ((i+1)modn)((i + 1) \bmod n) are adjacent.

Rikka has chosen two magic positive integers m,km,k. Now she wants to divide the garland into mm shorter ones such that the length of each sub-garland is a multiple of kk, flowers in each sub-garland keep in order as they used to be in the garland, and there exist two distinct "B"s in each sub-garland that are adjacent. You need to answer if there exist valid partitions, and if so, output any of them.

Formally, let t\[i](i=0,1,,n1)t\[i] (i = 0, 1, \dots, n - 1) be the type of the flower with index ii (either "B" or "C"). A sub-garland containing cc flowers can be described as an ascending sequence A=A_0,A_1,,A_c1(A_i<A_i+1,i=0,1,,c2)A=\\{A\_0, A\_1, \dots, A\_{c - 1}\\} (A\_i < A\_{i + 1}, i = 0, 1, \dots, c - 2), which represents the indices in the original garland of those flowers. We also regard AA as the set of all items in the sequence AA. Rikka wants to find mm sequences S_1,S_2,,S_mS\_1, S\_2, \dots, S\_m such that _i=1mS_i=0,1,,n1\cup\_{i = 1}^{m} {S\_i} = \\{0, 1, \dots , n-1\\}, _i=1mS_i=n\sum\_{i = 1}^{m} {\lvert S\_i \rvert} = n, and for i=1,2,,mi = 1, 2, \dots, m, S_iS\_i is a multiple of kk and there exists x,yx, y (x,yZx, y \in \mathbb{Z}) meeting the conditions:

  • 0x,y<S_i0 \le x, y < \lvert S\_i \rvert;
  • xyx \neq y;
  • x(y+1)(modS_i)x \equiv (y + 1) \pmod{\lvert S\_i \rvert};
  • t\[S_i_x]=t\[S_i_y]=t\[{S\_i}\_x] = t\[{S\_i}\_y] = "B".

입력

The first line contains an integer T(1T105)T (1\le T\le 10^5), the number of test cases. Then TT test cases follow.

The input format of each test case is as follows:

The first line contains three integers n,m,k(1n,m,k106)n, m, k (1\le n, m, k\le 10^6), the length of the garland, the number of sub-garlands and the factor of sub-garlands' lengths.

The second line contains a string tt of length nn, where the ii-th character is either 'B' or 'C', representing t\[i](i=0,1,,n1)t\[i] (i=0, 1, \dots, n-1), the type of the flower ii.

It is guaranteed that the sum of nn in all test cases is at most 10610^6.

출력

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 mm lines. In each line, the first integer is the length of that sub-garland S_i\lvert S\_i \rvert. The following S_i\lvert S\_i \rvert integers are the indices in the original garland of the flowers in it, in ascending order.