In this question, Killjee gives you three integers N, M, and K. You need to find the magic value of three numbers.
Suppose P=∑Mi=N fibonacci[i]∗i! (factorial here), where fibonacci[0]=fibonacci[1]=1 and fibonacci[i] = fibonacci[i−1] + fibonacci[i−2]. The magic value is maximum X. Such that K∗X≤P.
Since the answer could be very large, you only need to print the magic value %109+7.
INPUT FORMAT
First line of input contains a single integer T, number of test case. T lines follow each containing three space separated integers N,M,K.
OUTPUT FORMAT
For each test case print a single integer, magic value of 3 numbers in new line.
INPUT CONSTRAINTS
For 1st test case
fib(1)=1,fac(1)=1 fib(2)=2,fac(2)=2 fib(3)=3,fac(3)=6
so P=1+4+18
now 6*3=18 which is closest multiple of 6 to 23. So, 3 is magic value for this case.