Hiding the string.
63% Success341 Attempts20 Points5s Time Limit256MB Memory1024 KB Max Code

Gotya ,Amu ,and VJ are playing a three player game. In the game, VJ states a statement on a piece of paper. The statement can either be true or false (i.e he is lying).
For each query gotya needs to tell the correct answer in order to win the game.
Amu being an omniscient knows whether VJ is lying or not. Also being a good friend of Gotya, she doesn't want him too loose.
So she decides him to help him in the following way:
1. She prints three strings s,a,b.
2. If s can be constructed with the help of the following equation then gotya knows that VJ is lying else will say he agrees to the statement .
Condition:-
s= randomString() + a + randomString() + b + randomString()
randomString() function can generate any random string of length >=0.
The plus operator stands for string concatenation

INPUT:- First line consist of an integer q representing number of queries. Next q lines consist of three strings s,a,b.

OUTPUT:- For each query , if VJ is lying print "YES" else print "NO"

CONSTRAINTS:-
1. 1<=s,a,b<=1000
2. All the strings contain alphabets in the lowercase format only.

Examples
Input
4
theroadnottaken  robert frost
porcupinetree    pine three
pyarekdhoklahai pyare ok
stablesort table so
Output
NO
NO
YES
YES

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading Editor...
Results