Scientists have discovered spatial zones (represented by two-dimensional arrays) where aliens have been detected. The cells of each array contain an integer value indicating the density of aliens at that specific location. Scientists need to identify certain hotspots, or "critical zones" that might indicate an increased threat to humans.
Input
A sequence of spatial zones, terminated by a zero. Each zone is indicated by:
Output
There are 3 pieces of information to be displayed:
Observation
It is mandatory to write at least one subroutine that reads an entire spatial zone. The subroutine receives a matrix by reference and fills it with values read from the input. However, it is probably convenient to create more subroutines for this problem.
Input
2 2 1 4 3 9 1 3 5 0 0 1 1 0 0 0 2 3 0 0 0 0 0 0 2 0
Output
(1,1) 9 9 (0,2) 7 3
Input
5 6 4 2 1 6 3 5 1 3 8 2 6 1 7 2 9 5 4 2 4 8 3 7 1 9 2 6 4 8 3 2 3 0
Output
(2,1) 52 9