Please Provide solutioin of Extend Socket (JSS CODE 1.0)

Here is the question Link : CodeChef: Practical coding for everyone

My Solution : Coding Blocks IDE

I am unable to get at which test case this is giving wrong ans, I have tried case, but at my end it is giving right answer. But On submitting it is considering it as wrong answer.

Please Someone provide the correct solution as well as explaination at where my code is giving wrong answer.


You can the solution here