Unsafe elements in a matrix

Problem Name:
Unsafe elements in a matrix
Site:HackerEarth
Links:
Tags:
Problem setters: