Given 3 integer N,R and M. You task is to calculate NCR%M.
The first line of the input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of 3 integers N,R and M.
For each test case output a single integer representing the value of NCR%M
4 2 1000003
3 1 1000003
5 3 1000003
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.