Test cases failed why?
@navin
Actually your code is correct. But there is slight mistake while printing output.
You don’t have to print “#n : ans” , You have to print “#testcase_number : ans”
Example : for tescase this
3
3
2
1
output should be
#1 : 5
#2 : 3
#3 : 2