Table of Contents

## Make Them Equal solution codeforces

**Theofanis has a string π 1π 2β¦π πs1s2β¦sn and a character πc. He wants to make all characters of the string equal to πc using the minimum number of operations.**

In one operation he can choose a number π₯x (1β€π₯β€π1β€xβ€n) and for every position πi, where πi is not divisible by π₯x, replace π πsi with πc.

Find the minimum number of operations required to make all the characters equal to πc and the π₯x-s that he should use in his operations.

### Make Them Equal solution codeforces

The first line contains a single integer π‘t (1β€π‘β€1041β€tβ€104)Β β the number of test cases.

The first line of each test case contains the integer πn (3β€πβ€3β 1053β€nβ€3β 105) and a lowercase Latin letter πcΒ β the length of the string π s and the character the resulting string should consist of.

The second line of each test case contains a string π s of lowercase Latin lettersΒ β the initial string.

It is guaranteed that the sum of πn over all test cases does not exceed 3β 1053β 105.

### Make Them Equal solution codeforces

For each test case, firstly print one integer πmΒ β the minimum number of operations required to make all the characters equal to πc.

Next, print πm integers π₯1,π₯2,β¦,π₯πx1,x2,β¦,xm (1β€π₯πβ€π1β€xjβ€n)Β β the π₯x-s that should be used in the order they are given.

It can be proved that under given constraints, an answer always exists. If there are multiple answers, print any.

### Make Them Equal solution codeforces

Example

3 4 a aaaa 4 a baaa 4 b bzyx

### Make Them Equal solution codeforces

output

0 1 2 2 2 3

### Make Them Equal solution codeforces

Note

Let’s describe what happens in the third test case:

- π₯1=2x1=2: we choose all positions that are not divisible by 22 and replace them, i.Β e. bzyx ββ bzbx;
- π₯2=3x2=3: we choose all positions that are not divisible by 33 and replace them, i.Β e. bzbx ββ bbbb.