F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Kazuha's String

Time 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
3 aa bbb bab acc acbacccac bbcacacbc
 

Sample Output
yes yes no
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 13:01:48, Gzip enabled