A sorted array consisting of n elements is given. m queries are provided. For each query, check whether the number x exists in the array.
The first line contains a natural number n(1≤n≤105).
The second line contains n numbers separated by spaces ai(1≤ai≤109).
The third line contains a natural number m(1≤m≤105).
The next m lines contain the numbers x(1≤x≤109).
For m lines, output True or False.
5 1 2 5 7 8 4 1 3 7 9
True False True False
Login to be able to submit.