Is this NP Hard?

Problem Name:
Is this NP Hard?
Site:HackerEarth
Links:
Tags:
Problem setters: