Why wrong answer

In my local system it works fine but here getting wrong answer every time.
Pls take a look at my code http://www.codechef.com/viewsolution/2590357

Priblem is A-E Hash function:- link