Help needed in CHFNSWPS

Problem:CodeChef: Practical coding for everyone
My solution:
CodeChef: Practical coding for everyone
Can anybody explain why my solution is wrong or provide any testcase for which it is giving wrong answer ?