HackerEarth Monk's Encounter with Polynomial problem solution - TheCScience