I am stuck in the problem https://www.codechef.com/ALKH2016/problems/VLD Any help will be appreciated…