DPAIRS WA?

why my answer showing wrong as well as TLE? even i tried the same way as it was mentioned in hint3
Link -CodeChef: Practical coding for everyone