You notice a disturbance in the area. Something on this particular day is strangely, off?
Is it because
has been sabotaged?Is it because both
and are nowhere to be found?Simply put, it's much more frightening than that.
Today marks the end of an era. [REDACTED] has finally had enough of scandals like
being able to freely roam around her majestic Empire. To ensure that her task is as quick as possible, she will be activating her Empire's secret stash of illegal weaponry, which has been crafted with only one purpose in mind - destruction.Since this is her Empire after all, the weapons have been specifically named after her - The Alicizer. [REDACTED] has not only one, not two, but an infinite stash of Alicizers, which she will be placing down at specific coordinates along her
Such a ruthless task will definitely face resistance, as basement art academy. 's basement workers have engineered a special line of defense that they will be using to protect themselves, called the Anti-Alicizer. Just like how Alicizers will be placed in large square-shaped chunks at a time, an Anti-Alicizer will be able to remove square-shaped chunks of Alicizers.
As a spectator of this war,
Input Specification
On the first line, there will be three space-separated integers -
The following
Format | Description |
---|---|
At the position |
|
Place down an Anti-Alicizer at position |
|
Query the length of the longest contiguous subsequence of Alicizers that goes strictly in one direction (Horizontal or Vertical), that includes at least one of the points in the range |
It is guaranteed that for all queries,
Output Specification
For each type
Constraints
Subtask 1 [30%]
Subtask 2 [70%]
No additional constraints.
Sample Input
5 5 4
1 1 1 2
1 2 3 2
3 1 1 1
3 1 1 2
Sample Output
2
4
Note: Passing the sample is not required for passing the subtasks.
Explanation
After the first two queries of type
In the third query, only the position
The longest contiguous subsequence of Alicizers that spans strictly on one direction, that includes
In the last query, the positions
The longest contiguous subsequence of Alicizers that spans strictly on one direction, that includes any of these points, would be the subsequence containing
Comments