I read through the problem statement and what i didnt understand is what is the point of having T (test cases). in the example provided with T=1 it shows one result 18. if i were to have T=2 what would another result be?

Hey thank you, I was able to solve the question. though it only awarded me 18 points to me. how do i fulfil for the other constrains also?. is it by limiting the user input of N and T by simply writing conditions to make sure they lie within the prescribed limit?

There is no need to write conditions for constraints, constraints are there to provide us information of input, which type of input will be given and what is the minimum maximum value of perticular variable

T represents number of independent sequences you need to give correct answer of. WA means that for some sequences, your output was wrong. Try finding out which sequence it might be or where you went wrong in your algorithm/code