|
||||||||||
Kazuha's StringTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/262144 K (Java/Others)Total Submission(s): 57 Accepted Submission(s): 32 Problem Description Kazuha has two strings $S_1$ and $S_2$ consisting of lowercase letters "$a$", "$b$" and "$c$", here are the possible operations: Add or Delete "$aa$" at any place of the string. Add or Delete "$bbb$" at any place of the string. Add or Delete "$cccc$" at any place of the string. Add or Delete "$abababab$" at any place of the string. Add or Delete "$acacac$" at any place of the string. Add or Delete "$bcbc$" at any place of the string. Add or Delete "$abc$" at any place of the string. Kazuha can operate any time with any operations, determine if $S_1$ can be transformed into $S_2$ . Input The first line contains one integer $T$ $(1 \le T \le 2 \times 10^5)$ . The first line of each test case contains a single string $S_1$ . The second line of each test case contains a single string $S_2$. It guaranteed that the length of each string does not exceed $10^5$, and the sum of string lengths does not exceed $2 \times 10^6$. Output For each test case, print a single line containing "yes" if $S_1$ can be transformed into $S_2$ and "no" otherwise. Sample Input
Sample Output
Source | ||||||||||
|