Please enter your email address or userHandle.
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
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.