Why wrong answer

In my local system it works fine but here getting wrong answer every time.
Pls take a look at my code CodeChef: Practical coding for everyone

Priblem is A-E Hash function:- link