Problem in solving " LAZYPROG - The lazy programmer " from spoj.

I was attempting LAZYPROG - The lazy programmer from spoj, but I couldn’t crack this problem. Anyone please explain in details the approach to solve this this problem.

Thanks in advance.

@dushyant7917 @sfialok98 @chandubaba @shubhparekh @vijju123 @dushyant7917 @hemant_dhanuka @rpatni @vivek_1998299 @rohitthapliyal @the_extractor @baz__ @mathecodician @ritwikshanker @kauts_kanu

Can you please look into it.

This might help you !!