wrong answer for RMQ

Problem :- CodeChef: Practical coding for everyone

My solution :- CodeChef: Practical coding for everyone

// <O(n),O(sqrt(n))>

I implemented the above complexity algorithm given at topcoder
link:- Topcoder

Can anyone tell me Why the two classes which i coded for RangeMinimumQuery and RangeMaximumQuery giving wrong answer
PLZ Help