#Lutece3286. Herman's Habit
Herman's Habit
Migrated from Lutece 3286 Herman's Habit
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Bill 发现了两串魔法咒语,身为大魔法师,他敏锐地发现这两串咒语都是由两个基础咒语 变化而来。
- 第二串魔法咒语 是由 直接拼接得到的,即 。
- 第一串魔法咒语 比较复杂,它并不是由 直接拼接而来,但 是 的子序列,并且没有位置重叠。
现在 Bill 给了你 组魔法咒语,对于每组魔法咒语,你只需要判断它们是否是由两个基础咒语变化而来。
Input
第一行一个整数 表示魔法咒语组数。
接下来有 组只包含小写字母的魔法咒语,每组咒语两行。
第一行表示魔法咒语 。
第二行表示魔法咒语 。
Output
行,每行一个字符串YES
或NO
,表示这两个魔法咒语是否为两个基础咒语变化而来。
Samples
1
ababcb
abcba
YES
Constraints
Resources
2024 UESTC ICPC Training for String