Problem Description
XYZ is playing an interesting game called "drops". It is played on a
r∗c grid. Each grid cell is either empty, or occupied by a waterdrop. Each waterdrop has a property "size". The waterdrop cracks when its size is larger than 4, and produces 4 small drops moving towards 4 different directions (up, down, left and right).
In every second, every small drop moves to the next cell of its direction. It is possible that multiple small drops can be at same cell, and they won't collide. Then for each cell occupied by a waterdrop, the waterdrop's size increases by the number of the small drops in this cell, and these small drops disappears.
You are given a game and a position ( x , y ), before the first second there is a waterdrop cracking at position ( x , y ). XYZ wants to know each waterdrop's status after T seconds, can you help him?
1≤r≤100 , 1≤c≤100 , 1≤n≤100 ,
In every second, every small drop moves to the next cell of its direction. It is possible that multiple small drops can be at same cell, and they won't collide. Then for each cell occupied by a waterdrop, the waterdrop's size increases by the number of the small drops in this cell, and these small drops disappears.
You are given a game and a position ( x , y ), before the first second there is a waterdrop cracking at position ( x , y ). XYZ wants to know each waterdrop's status after T seconds, can you help him?
1≤r≤100 , 1≤c≤100 , 1≤n≤100 ,