DCEPC13D - The Ultimate Riddle
The Joker has played his cards again. This time he has chosen to attack DCE Coders. Gitanshu, and other coders have been abducted.
Mishra has solved the first part of the riddle and estimated N locations. Now, it's upto you to choose R locations among these N.
Calculate the number of ways you can chose the R locations . Since the answer can be large calculate the answer modulo M .
First line contains T number of testcases .
Each line contains 3 integers N,R,M .
Output the required answer
1 <= T <= 104
1 <= M <= 109
1 <= R <= N <= 109
M is a square-free number having prime factors less than 50 .
Input: 4 5 2 1001 5 2 6 20 6 210 13 4 39
Output: 10 4 120 13
Time limit is too strict for python!!
@Min_25 You are right, there was a problem in an input file.
A hint to others: Check for empty lines in the input file, and output 0 as answer for these.
Could there be a problem with the input data?