STRSRC - Simplest Pattern Search

Given a String S and a pattern P, check whether P exists in S or not.

Input

In first line is the number of test cases T. 1 <= T <=50.

Next 2*T lines contains a string S and string P.

1 <= size of string S <= 1000 and it will contain only 'a'-'z'. 1 <= size of pattern P <= 1000 and will contain only 'a'-'z'.

Output

Print 'Yes' if P is found is S else print 'No'.

Example

Input:
1
abc
b

Output: Yes

Added by:Rajesh Kumar
Date:2014-08-23
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2014-08-24 16:27:54 nitant
output should be in the same line or in separate lines??

Ans - It should be in separate lines.

Last edit: 2014-08-31 02:33:50
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.