MATRIX RELOADED

Can anyone expalain why is it giving TLE for the problem:CDXM2 Problem - CodeChef.
Solution submitted by me:CodeChef: Practical coding for everyone.