HackerEarth Hunger Games problem solution - TheCScience