#P1009. String minus
String minus
题目描述
For a string like the plus operation is very obvious that but little m defined a new way to operate the strings, which is the operation minus.
For two given strings and :
If the length of is not shorter than the length of then do else do
means removing the longest sequence from by referencing , and after that if there are left characters in do or if we do at first.
For example:
Let us define and
Then is first removing the longest sequence from by referencing , after that (removes at index 1 and removes at index 3, because if we can remove some characters, we will immediately remove them) after that
Then do , so
For more precisely, reference only from the begin of string to the end of string and will only do once, For example:
We suppose and the referencing operation is first check , it is obvious that so remove both character from and . Then check , we can see taht , so we continue referencing, then we can see that so we both remove character from and , then we can get the answer for is
picture: some strings
输入格式
The first line contains one positive integer indicating the number of the test cases.
Then for next lines, each line contains two strings
It is guaranteed that only contains lower-case English letters.
输出格式
For each test case, print one line
样例
6
aabad abc
a baaa
a aaa
b a
cdaab caab
abc acb
aadc
baa
aa
ba
d
bb
提示
Please notice for the sixth test case - equals