{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e精通图论的算法大师绝不会容忍任何不连通的子图。\u003c/p\u003e\u003cp\u003e美容师只会考虑由边引起的子图作为必要的子图。\u003c/p\u003e\u003cp\u003e强迫症患者总是会随机选择给定简单无向图中的一个子图。\u003c/p\u003e\u003cp\u003e这就是为什么皮卡德要求你计算,从给定的简单无向图中以相等概率选择四条不同的边,所选边所形成的边引起的子图是连通的概率。这里我们说图中边的一个子集以及子集中所有端点所形成的子图是边引起的子图。\u003c/p\u003e\u003cp\u003e为了避免任何精度问题,皮卡德用$$$p$$$表示概率,用$$$m$$$表示边的数量,你应该报告值$$$\\left(p \\cdot \\binom{m}{4}\\right) \\bmod (10^9 + 7)$$$。很容易证明$$$p \\cdot \\binom{m}{4}$$$是一个整数。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入包含多个测试用例,第一行包含一个正整数$$$T$$$,表示测试用例的数量,最多为$$$10$$$。\u003c/p\u003e\u003cp\u003e对于每个测试用例,第一行包含两个整数$$$n$$$和$$$m$$$,表示给定简单无向图中的顶点数和边数,其中$$$4 \\leq n \\leq 10^5$$$和$$$4 \\leq m \\leq 2 \\times 10^5$$$。\u003c/p\u003e\u003cp\u003e接下来的$$$m$$$行描述图的所有边,其中第$$$i$$$行包含两个整数$$$u$$$和$$$v$$$,表示第$$$u$$$个顶点和第$$$v$$$个顶点之间的一条边,其中$$$1 \\leq u, v \\leq n$$$和$$$u \\neq v$$$。\u003c/p\u003e\u003cp\u003e我们保证给定的图中不包含环或多重边。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,输出一行包含一个整数,对应于值$$$\\left(p \\cdot \\binom{m}{4}\\right) \\bmod (10^9 + 7)$$$,其中$$$p$$$表示你被要求计算的概率。\u003c/p\u003e"}},{"title":"示例1","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\u003e2\n4 4\n1 2\n2 3\n3 4\n4 1\n4 6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n15\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}