In the game Minesweeper, every cell can either be a number or a bomb. If it’s a number, it shows how many bombs are around that cell (the neighboring 8 cells - the top, bottom, left, right, and all the diagonally adjacent cells).
field, it’s required to place
bbombs on the field, and print the final field in the output. All the coordinates with a bomb should have a
binstead of a number.
The first line of the input contains 2 numbers the height
wof the field (1 ≤ h, w ≤ 50). The second line contains the number of bombs
b. Each of the next
blines contains the coordinates of the bombs
(row and column, where the numbering starts from 1).
The program should output the final grid, where each cell is either a bomb annotated with a
b, or one of the numbers which represent the number of adjacent bombs to that cell.
3 2 2 1 1 2 2
b 2 2 b 1 1