i am confused how to take input
How to take input and pass it to fuction
Since there are multiple test cases in the input format, first you will take a single variable ‘t’ as input which will be number of test cases. Then you will have to put a loop from 1 to t and inside this loop you will take input for m and n, and make the function call and print answer for this test case. Then increment the value of ‘t’. This way you can take input for multiple test cases.
I hope I have answered what you wanted to ask. If my answer is unclear or I’ve misunderstood your question, then let me know!