CPython lite logoProblemsContests

46. Binary Search #1

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.


Input

The first line contains a natural number n(1n105).

The second line contains n numbers separated by spaces ai(1ai109).

The third line contains a natural number m(1m105).

The next m lines contain the numbers x(1x109).

Output

For m lines, output True or False.


Sample input 1

5
1 2 5 7 8
4
1
3
7
9

Sample output 1

True
False
True
False

Login to be able to submit.

NormalAlgorithmsData structuresLoops
155 / 39
Solved / unsolved count
1.0 s / 512 MB
Limits