What is the error in my code

no any test cases are passes

You should initialise ms and cs for each testcase as the answers of each testcase are independent of each other.