Search Multiple Strings
Given a long text t
and n
strings , you are asked to check for each of the strings if they are a substring of
t
.
Input
The first line of the input contains the text t
(1 ≤ |t| ≤ ).
The next line contains a single integer n
(1 ≤ n ≤ ).
The next n
lines contain strings (1 ≤ || ≤ min(50, |t|)).
Output
The program should print n
lines. Each line should contain Yes
if the corresponding string is a substring of t
, and No
otherwise.
Examples
Input | Output |
---|---|
habababohabo 3 ba yoyo ababoha | Yes No Yes |
Constraints
Time limit: 10 seconds
Memory limit: 1000 MB
Output limit: 1 MB