All submissions for this problem are available.### Read problem statements in [Hindi](http://www.codechef.com/download/translated/LTIME79/hindi/CHEALG.pdf),[Bengali](http://www.codechef.com/download/translated/LTIME79/bengali/CHEALG.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/LTIME79/mandarin/CHEALG.pdf), [Russian](http://www.codechef.com/download/translated/LTIME79/russian/CHEALG.pdf), and [Vietnamese](http://www.codechef.com/download/translated/LTIME79/vietnamese/CHEALG.pdf) as well. One day, Saeed was teaching a string compression algorithm. This algorithm finds all maximal substrings which contains only one character repeated one or more times (a substring is maximal if it we cannot add one character to its left or right without breaking this property) and replaces each such substring by the string "cK", where $K$ is the length of the substring and $c$ is the only character it contains. For example, "aabaaa" is compressed to "a2b1a3". Saeed wanted to check if the students understood the algorithm, so he wrote a string $S$ on the board and asked the students if the algorithm is effective on $S$, i.e. if the string created by compressing $S$ is strictly shorter than $S$. Help them answer this question. ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - The first and only line of each test case contains a single string $S$. ### Output For each test case, print a single line containing the string `"YES"` if the algorithm is effective on $S$ or `"NO"` if it is not. ### Constraints - $1 \le T \le 100$ - $1 \le |S| \le 10^3$ - $S$ may consist of only lowercase English letters. ### Subtasks **Subtask #1 (100 points):** original constraints ### Example Input ``` 3 bbbbbbbbbbaa c aaaaaaaaaabcdefgh ``` ### Example Output ``` YES NO NO ``` ### Explanation **Example case 1:** - The compressed string of "bbbbbbbbbbaa" is "b10a2", which is shorter. - The compressed string of "c" is "c1", which is not shorter than "c". - The compressed string of "aaaaaaaaaabcdefgh" is "a10b1c1d1e1f1g1h1", which is not shorter than "aaaaaaaaaabcdefgh" (both strings have length $17$).
|Tags||deadwing97, easy, i_love_islam, implementation, ltime79|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.