Click here to read the complete problem statement.
How to solve this one. Can someone give me some clue?