O(n) failed in java CHEFMGX problem in Starters 16

i got TLE in CodeChef: Practical coding for everyone
and the solution i used is (CodeChef: Practical coding for everyone) and in this code i have written in O(n) complexity eventhough i got TLE and i request to give Java users some more time for the solution or just evaluate the solution based on a particular predeclared function without considering IO;
Atlast i wrote the same solution in C (CodeChef: Practical coding for everyone) it got AC;