题号:NC208877
时间限制:C/C++/Rust/Pascal 5秒,其他语言10秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
ZYB likes to create puzzles for himself and then solve them.
There are

(

is odd)
distinct integers written in a line on the blackboard, and you decide to erase those numbers from the blackboard.
Since you have just learned the concepts of median during the lecture, you invented the following
erase-operation for three integers: wipe off the largest number and the smallest number from the blackboard, so that only the median of the three numbers remains. You decide to repeat the following process: choose three
consecutive integers on the blackboard and apply
erase-operation on them. After this operation, the number of integers on the blackboard will decrease by 2. Eventually, there will be only one integer left after this process is repeated

times.
ZYB comes up with an interesting question: which integers may survive until the end?
输入描述:
The input contains multiple cases. The first line of the input contains a single integer
, the number of cases.
For each case, the first line of the input contains a single integer

(

,

is odd), the number of integers on the blackboard initially. The second line contains

distinct integers
)
, where
)
denotes the

-th integer on the blackboard.
It is guaranteed that the sum of
over all cases doesn't exceed
.
输出描述:
For each case, print a string consisting of
characters in a single line. The
-th
character of the string should be 1 if it is possible for
to remain as the only integer in the end, otherwise it should be 0.