#P13549. 热辣滚烫
热辣滚烫
Description
Little L abstracts the plot of movie A as a string of length .
Little L abstracts the plot of movie B as a string of length .
If Little L can insert any string (which can be empty) either before or after any character in to obtain a new string such that , then we say movie B is "Yolo".
Little L has a total of queries. For each query, you need to determine whether movie B is "Yolo". If yes, output Yes; otherwise, output No.
Input Format
This problem contains multiple test cases.
The first line contains a positive integer , the number of test cases.
For each test case:
- The first line contains two positive integers and , separated by a space, representing the lengths of strings and .
- The second line contains the string .
- The third line contains the string .
Output Format
Output lines, each containing either Yes or No, indicating whether movie B is "Yolo".
9
3 4
aab
aabb
3 5
xyz
xabyz
3 5
xyz
axbyz
4 4
aabb
aabb
3 3
aab
abb
4 6
abgd
xyabgd
4 6
abgd
abgdgd
3 6
abb
aabbab
3 6
abb
aabbbb
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
Hint
Explanation of Sample 1:
For the first test case, you can insert the string b after the last character of to get .
For the second test case, you can insert the string ab after the first character of to get .
For the third test case, it can be proven that no such operation exists to make .
For the fourth test case, you can insert an empty string after the third character of to get .
For the sixth test case, you can insert the string xy before to get .
Constraints
| Test Case | Special Property | ||
|---|---|---|---|
| A | |||
| None | |||
| B | |||
| None | |||
Special Property A: .
Special Property B: .
For of the test cases:
- ,
- ,
- Strings and consist of lowercase letters only.
Generated by Deepseek V3.
京公网安备 11011102002149号