HackerEarth Divide Apples problem solution - TheCScience