| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12754 | DS_Quiz2_PlantFlower |
|
Description
The simulation takes place in one matrix(X, Y).
The seeds will be randomly planted into the matrix.
The seed is planted followed by the coordinate and what type of flower it is.
If two seeds are planted too close, they will fight for nutrition hence grow fewerer flowers.
- Ideally, with enough nutrition, each seed will grows eight flowers.
- However, each seed in the orthogonally adjacent cell will reduce the number of flowers to one-half.
- If there are seeds in more than 3 orthogonally adjacent cells, there will be no flowers.
Your goal is 1) to count the number of flowers in total; 2) to provide the names of flowers in the target column.
Input
You will receive several lines:
First line includes 3 numbers: #row, #column, target column.
Second line has an number, which means the #of seeds plant.
And following lines will write in the format: inserted row, inserted column, flower name.
Output
First line prints out the total number of bloom flowers.
Second line prints out the names of flowers in the target column. (No space or ‘\n’ at the end.