PRAYAAS 2015 solutions

Hello!

The Prayaas contest ended a few days ago but the solutions are not made public yet. I am stuck on the following problem (http://www.codechef.com/PRYS2015/problems/PRYS03 ) from quite some time and would like to know a solution or a possible approach.

Any help is appreciated. Thanks!

even i am waiting for the solutions.Please upload editorial or make solution public.Thanks