I cant find what is the error in my code.pls help

My testcases are failing , but output is correct for sample input and other inputs that i gave

you are not leaving line after printing solution for each testcase
Corrected code: