All Tracks Data Structures Hash Tables Basics of Hash Tables Problem

KK and crush
/
No tags
Problem
Editorial
Analytics

KK has a crush on a girl in his class. In this valentines day he planned to propose her.

KK's crush will accept his proposal if KK solves the following problem:-

Given an array A of n numbers and k queries. In each query we have a number x .Now KK has to tell to whether number x exists in array or not.

Can you help KK?

*Input :- *

First line contains number of test cases t.First line of each test case contains number of elements n in array A. Second line contains n elements of array of A.Third line contains k(number of queries). Following k lines contain a number x.

*Output :- *

For each query in a test case print "Yes" or "No" ( Quotes for clarity ).

Constraints:-

1<=t<=12 (t= Number of test cases in each input file).

1<=n<=10^5 (n=number of elements in array).

-10^5<=A[i]<=10^5 (A[i]=ith element of array).

1<=k<=10^4 (k=number of queries).

-10^5<=x<=10^5 (x=Number asked to search for in each query).

SAMPLE INPUT
2
5
12 13 -4 3 2
6
15
11
13
2
3
12
6
12 3 -67 67 34 2
4
4
5
67
7
SAMPLE OUTPUT
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

Initializing Code Editor...
Notifications
View All Notifications

?