HackerEarth Protect the Cities problem solution - TheCScience