https://www.codechef.com/LTIME70B/problems/POGOSTCK