{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003ePatrick Star bought a bookshelf, he named it ZYG !! \u003cbr\u003e\u003cbr\u003ePatrick Star has $N$ book .\u003cbr\u003e\u003cbr\u003eThe ZYG has $K$ layers (count from $1$ to $K$) and there is no limit on the capacity of each layer !\u003cbr\u003e\u003cbr\u003eNow Patrick want to put all $N$ books on ZYG :\u003cbr\u003e\u003cbr\u003e1. Assume that the i-th layer has $cnt_i(0 \\le cnt_i \\le N)$ books finally.\u003cbr\u003e\u003cbr\u003e2. Assume that $f[i]$ is the i-th fibonacci number ($f[0] \u003d 0, f[1] \u003d 1, f[2] \u003d 1, f[i] \u003d f[i - 2] + f[i - 1]$). \u003cbr\u003e\u003cbr\u003e3. Define the stable value of i-th layers $stable_i \u003d f[cnt_i]$.\u003cbr\u003e\u003cbr\u003e4. Define the beauty value of i-th layers $beauty_i \u003d 2^{stable_i} - 1$.\u003cbr\u003e\u003cbr\u003e5. Define the whole beauty value of ZYG $score \u003d gcd(beauty_1, beauty_2, ..., beauty_k)$(Note: $gcd(0, x) \u003d x$).\u003cbr\u003e\u003cbr\u003ePatrick Star wants to know the expected value of $score$ if Patrick choose a distribute method randomly !\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contain a integer $T$ (no morn than 10), the following is $T$ test case, for each test case :\u003cbr\u003e\u003cbr\u003eEach line contains contains three integer $n, k(0 \u0026lt; n, k \\le 10^6)$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output the answer as a value of a rational number modulo $10^9 + 7$.\u003cbr\u003e\u003cbr\u003eFormally, it is guaranteed that under given constraints the probability is always a rational number $\\frac{p}{q}$ (p and q are integer and coprime, q is positive), such that q is not divisible by $10^9 + 7$. Output such integer a between 0 and $10^9+6$ that $p-aq$ is divisible by $10^9+7$."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n6 8\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e797202805\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}