#P10078. [GDKOI2024 普及组] 正方形扩展
[GDKOI2024 普及组] 正方形扩展
Problem Description
Now, on the Cartesian coordinate system (an infinitely large 2D plane), there are bacteria of different types, and their coordinates are all distinct.
As time goes on, the bacteria keep reproducing. They expand their territory in the shape of squares, all with the same square expansion speed.
More specifically, for any time and any point on the plane, suppose there exists type bacteria at point . Then there are two cases:
-
If every square centered at point contains bacteria of other types, then the bacteria at this point will not expand (this can be called “contact inhibition”).
-
If there exists a square centered at that contains no bacteria of other types, then the bacteria at this point will expand.
Note that newly expanded bacteria of the same type also have the same expansion ability.
Here are some simple examples of square expansion:
If initially there is only one bacterium at on the plane, then after one unit of time, this type of bacteria will occupy the square surrounded by , , , .
If initially there are two bacteria at and , then eventually will become the boundary line of their territories. The bacteria initially at will occupy all the area to the left of , and the bacteria initially at will occupy all the area to the right of .
Now, for the -th type of bacteria, you need to determine whether its occupied area can grow to infinity.
Input Format
The first line contains a positive integer , indicating the number of bacterial mothers.
Then follow lines, each containing two integers, representing the point coordinates , i.e., the position of the mother of type bacteria.
Output Format
Output a string of length . For the -th character, means the occupied area of type bacteria can expand to infinity, and means the final area is finite.
5
0 0
2 0
2 2
0 2
1 1
11110
3
-2 0
0 0
2 0
111
7
-7 -8
5 -9
1 -5
9 -4
-8 3
-2 -3
-4 -6
1101110
Hint
Sample Explanation
In the second sample, the territory finally owned by point is the region between the lines and , and its area tends to infinity.
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5