Wrong test case
Hey @aryanraj you need to print the answer for each ‘t’ in a new line, so please use cout<<endl; after printing the answer for each t and then your code works fine.
If you still have any further doubts please feel free to ask,otherwise kindly mark the doubt as resolved.