#D8763. Binary Search
Binary Search
Binary Search
For a given sequence which is sorted by ascending order, find a specific value given as a query.
Constraints
- $0 \leq a_0 \leq a_1 \leq ... \leq a_{n-1} \leq 1,000,000,000$
Input
The input is given in the following format.
:
The number of elements and each element are given in the first line and the second line respectively. In the third line, the number of queries is given and the following lines, integers are given as queries.
Output
For each query, print 1 if any element in is equivalent to , and 0 otherwise.
Example
Input
4 1 2 2 4 3 2 3 5
Output
1 0 0
inputFormat
Input
The input is given in the following format.
:
The number of elements and each element are given in the first line and the second line respectively. In the third line, the number of queries is given and the following lines, integers are given as queries.
outputFormat
Output
For each query, print 1 if any element in is equivalent to , and 0 otherwise.
Example
Input
4 1 2 2 4 3 2 3 5
Output
1 0 0
样例
4
1 2 2 4
3
2
3
5
1
0
0
</p>