HackerEarth Team division problem solution - TheCScience