#GYM104671C. Destroy Columbia
Destroy Columbia
Description
Columbia University has created a new song in honor of itself, which can be represented as a string $s_1s_2...s_n$. As a Columbia-hater, this string makes you incredibly angry, so you decide to desecrate it by performing the following operation:
You select a nonempty integer sequence $i_1, i_2, ..., i_k$ such that $1 \leq i_1 < i_2 < ... < i_k \leq n$, and create a new string $t$ as follows: initially all of the characters of $t$ are the same as $s$. Then, for all $1 \leq j \leq k$, you set $t_{i_j}$ to be $s_{i_{k - j + 1}}$. In other words, $t$ is the same as $s$, but with the characters at positions $i_1, i_2, ..., i_k$ reversed.
Your objective is to select $i_1, i_2, ..., i_k$ such that $t$ does not contain the string columbia as a subsequence. Please find any $i_1, i_2, ..., i_k$ that satisfies this, or report that it is impossible.
A subsequence of a string $s$ is defined as any new string that can be obtained from the deletion of zero or more characters from $s$ and concatenating the remaining parts. For example, columbia is a subsequence of cxoxlxuxmxbxixa.
The first and only line consists of a single string $s_1s_2...s_n$ $(1 \leq n \leq 2 \cdot 10^5)$. All $s_i$ will be lowercase letters from the English alphabet.
If it is possible to pick an integer sequence $i_1, i_2, ..., i_k$ that satisfies the constraints of the problem, output any such sequence as follows: on the first line, output a single integer $k$ $(1 \leq k \leq n)$ describing the length of the sequence. On the second line, output $k$ space-separated integers $i_1, i_2, ..., i_k$ $(1 \leq i_1 < i_2 < ... < i_k \leq n)$.
Otherwise, if no such sequence exists, output a single line with the string NO.
Input
The first and only line consists of a single string $s_1s_2...s_n$ $(1 \leq n \leq 2 \cdot 10^5)$. All $s_i$ will be lowercase letters from the English alphabet.
Output
If it is possible to pick an integer sequence $i_1, i_2, ..., i_k$ that satisfies the constraints of the problem, output any such sequence as follows: on the first line, output a single integer $k$ $(1 \leq k \leq n)$ describing the length of the sequence. On the second line, output $k$ space-separated integers $i_1, i_2, ..., i_k$ $(1 \leq i_1 < i_2 < ... < i_k \leq n)$.
Otherwise, if no such sequence exists, output a single line with the string NO.
cxoxlxuxmxbxixa
columbiaisthebestschoolevercolumbiakidsarekindandclever
wellstaynumberoneforever
3
1 2 3
6
1 30 31 32 33 34
1
1
Note
In the first sample test case, the characters at positions $1, 2, 3$ are reversed. The string becomes oxcxlxuxmxbxixa, which does not contain columbia as a subsequence.
In the second sample, the new song is iolumbiaisthebestschoolevercobmulcakidsarekindandclever. I think the song is greatly improved this way!
In the third sample, the string doesn't even have the letter c in it, so any valid output is a valid solution.