Updated problem name
Moving people
Updated problem statement
The people of your city are living in a x grid. If a person is out of the grid after multiple instructions, then that person is not counted in further steps.
Initially, there is at most one person in every cell of this grid. You can perform operations or query of the following types:
Input format
Output format
For each type of query, print the number of persons that are available in the grid at the time of that query.
Constraints
After update operation, the grid will look like this:
After the update operation, the grid will look like this:
After the update operation, the grid will look like this: