Let's Swap
题号:NC237096
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Joseph developed an editing software called Pandote recently, and now he is testing it to make sure it works correctly, otherwise, he will probably get fired!
Joseph starts his testing by implementing copying and pasting as well as reversing operations to the string on the Pandote. More specifically, in each step, if the string on the screen is S, he will do the following operations in order.
  1. Choose a prefix of length , then S can be denoted by . Note that the string B can be empty.
  2. Swap the two parts and get the string BA.
  3. Reverse the whole string and get the string .
However, since the function of Pandote is limited, there are only two different lengths l_1 and l_2 of prefix he can choose in each step. Now Joseph wants to know whether he can convert the string S to T through several (possibly zero) steps.

输入描述:

The first line of the input gives the number of test cases . T test cases follow.
For each test case, the first line contains the string S and the second line contains the string T. Both S and T are consisting of lowercase Latin letters and .
the third line contains two integers l_1 and , denoting the length of the prefix he can choose in each step.
It is guaranteed that the sum of over all test cases does not exceed .

输出描述:

For each test case, print  if he can convert S to T. Otherwise, print .
示例1

输入

复制
3
ljhelloh
hellohlj
2 4
thisisastr
htrtsasisi
3 5
abcde
bcdea
1 4

输出

复制
yes
no
yes

说明

For the first testcase, one possible method is \texttt{ljhelloh} \stackrel{4}{\longrightarrow} \texttt{ehjlholl} \stackrel{2}{\longrightarrow}\texttt{hellohlj}