#P10368. 「LAOI-4」Colors
「LAOI-4」Colors
Background
Do this problem:

Problem Description
Given a string of length .
- If , then is called "erasable".
Define one operation as: erase all "erasable" characters in .
Please output after performing the operation times.
Input Format
The first line contains two positive integers , representing the number of test cases and the subtask ID.
For each test case, the first line contains a positive integer and an integer .
The next line contains a string of length .
Output Format
For each test case, output one line with a string representing the answer.
3 0
3 1
aba
5 2
acaca
3 0
abc
aa
aa
abc
Hint
Explanation of the samples:
- For the -st test case, the string is , and after one operation it becomes .
- For the -nd test case, the string is , and after one operation it becomes , and after two operations it becomes .
- For the -rd test case, the string is , and after zero operations it is .
"This problem uses bundled testdata."
| Special Property | Subtask Dependency | Total Score | ||
|---|---|---|---|---|
| None | ||||
| None | ||||
| None | ||||
| None |
For of the testdata, , , , and the strings consist of lowercase letters.
Special property : is a permutation of .
Special property : .
Special property : It is guaranteed that each can only take two possible values.
Translated by ChatGPT 5