Problem of Problem Curator
In a Online adaptive test there are problems of N difficulty levels ( 1 being the easiest and N being the hardest). Each difficulty level will have a certain pool of questions.
A examinee will first be given a question from the pool of (N+1)/2 th difficulty level and based on his answer he’ll be promoted or demoted to next or previous level i.e. next he’ll get a question from pool of (current difficulty level +1/-1) if he gives right/wrong answer respectively.
Tejas being the Problem curator for the test, is worried about the number of problems to be added to the pool of questions of each difficulty level. He knows that there is a 50% probability that the examinee will give a right answer and 50% probability that he'll give a wrong answer.
Tejas wants his test to be ideal so he wants that everytime the examinee should get a unique question, keeping this in mind find the Expected value of number of questions at each level.
Each question requires exactly one unit of time. Duration of test is K minutes.
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follow :
- The first line of each test case contains two space seperated integers N K, denoting the number of levels and duration of test .
For each test case, print N space seperated integers denoting the Expected value of number of questions at i th level (1<=i<=n) modulo 1000000007 on new line. The expected value is represented in the form of P/Q, print P⋅Q−1 modulo 1000000007.
- 1 ≤ T ≤ 500
- 1 ≤ N < 5000
- 1 ≤ K ≤ (N+1)/2
- N is odd
500000004 1 500000004
0 0 125000001 250000002 875000007 500000005 875000007 250000002 125000001 0 0
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions