{"trustable":false,"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":"MD","content":"有 n 个房间,编号为 1 到 n,每个房间对应有一把钥匙。现在把这 n 把钥匙随机地放在这 n 个房间中,并把门锁上。现在要将这 n 个房间的门都打开,你有 k 次把门炸开的机会,不过 1 号房间的门过于坚固炸不开。问能够成功打开所有门的概率。"}},{"title":"Input","value":{"format":"MD","content":"第一行一个整数 T (T\u003c\u003d20),表示测试数据组数。\n\n接下来 T 行,每行两个整数 n,k (2\u003c\u003dn\u003c\u003d20,1\u003c\u003dk\u003cn)。"}},{"title":"Output","value":{"format":"MD","content":"对每组测试数据,输出成功的概率,四舍五入至小数点后四位。"}},{"title":"Sample Input","value":{"format":"MD","content":"3\n3 1\n3 2\n4 2"}},{"title":"Sample Output","value":{"format":"MD","content":"0.3333\n0.6667\n0.6250"}}]}