Need hints to solve an ICPC problem

Can anyone provide me hints to solve below mentioned problem?

Problem Link