Math, asked by geethikasaila1231, 7 months ago

Lazy StudentProblem DescriptionThere is a test of Algorithms. Teacher provides a question bank consisting of N questions and guarantees all the questions in the test will be from this question bank. Due to lack of timeand his laziness, Codu could only practice M questions. There are T questions in a question paper selected randomly. Passing criteria is solving at least 1 of the T problems. Codu can'tsolve the question he didn't practice. What is the probability that Codu will pass the test?Constraints0<T <= 100000 < N, I = 10000 <= M<= 1000MT<= N-- Input FormatFirst line contains single integer T denoting the number of test cases.First line of each test case contains 3 integers separated by space denoting N, T, and M.- OutputFor each test case, print a single integer.If probability is p/q where p & q are co-prime, print (p*mullnv(q)) modulo 1000000007, where mullnv(x) is multiplicative inverse of x under modulo 1000000007.​

Answers

Answered by hania96
1

Answer:

Lazy Student Problem Description There is a test of Algorithms. Teacher provides a question bank consisting of N questions and guarantees all the questions in the test will be from this question bank. Due to lack of time and his laziness, Codu could only practice M questions. There are T questions in a question paper selected randomly. Passing criteria is solving at least 1 of the T problems. Codu can't solve the question he didn't practice. What is the probability that Codu will pass the test? Constraints 0 < T <= 10000 0 < N, T <= 1000 0 <= M <= 1000 M,T <= N Input Format First line contains single integer T denoting the number of test cases. First line of each test case contains 3 integers separated by space denoting N, T, and M. Output For each test case, print a single integer. If probability is p/q where p & q are co-prime, print (p*mulInv(q)) modulo 1000000007, where mulInv(x) is multiplicative inverse of x under modulo 1000000007. Timeout 1 Test Case Example 1 Input

1

SEE ANSWER

Log in to add comment

Answers

Me · Beginner

Know the answer? Add it here! 

himasai55 

 

Helping Hand

Explanation:

The probability is ½. So output is 500000004.

1.6

19 votes

THANKS 3

Comments 

 

Report

The Brain 

 

Helper

Not sure about the answer?

SEE NEXT ANSWERS

Newest Questions

X/2!-x/5!+x/8!...x/n! in javaWhat is the purpose of a gatewayAn interpreter is faster than a compiler.(__) True or falseProgram to input two numbers and find averageThe problem solvers have found a new island for coding and named it as philalandSoftware is not a necessary part of the computer.(__) True or falseCommand is present in the......... group?A joystick is used for playing games.(__) True or falseWhats are some best practices when choosing website namesWhen you insert a wordArt in a document,................tab appears on the ribbon

Similar questions