Bomb Blast - No Water
Bomb Blast - No Water PROBLEM STATEMENT : A matrix of size R*C containing positive integer values is passed as the input. An integer value which is a multiple of 5 is a bomb and will destroy all four adjacent cells (in the following order - left, right, top and bottom ). But if the adjacent cell is water (the integer value will be a multiple of 3), then the bomb will stop destroying the adjacent cells. If a cell is destroyed then the value of that cell becomes 0. After the bomb is blasted then the cell value becomes 0 . If the cell value is both a multiple of 5 and 3, then consider that as water. Finally, the program must print the values in the matrix as the output. Note: The bombs are triggered from right to left starting from the last row. Boundary Condition(s): 1 <= R, C <= 100 Input Format: The first line contains R and C separated by a space. The next R lines contain C integer values each. Output Format: Th...