this is my code, it gives WA on codechef but it gives correct answer for the given test cases in the question