{"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\"\u003e小A是一个天文爱好者,他发现天空是如此美丽!\u003cbr\u003e\u003cbr\u003e所以他现在正在数星星!\u003cbr\u003e\u003cbr\u003e天空中有n颗星星,小A已经用m条无向边连接了它们。\u003cbr\u003e\u003cbr\u003e保证没有边连接一颗星星和自己,每两条边连接不同的星星对。\u003cbr\u003e\u003cbr\u003e现在小A想知道天空中有多少不同的“A-结构”,你能帮帮他吗?\u003cbr\u003e\u003cbr\u003e“A-结构”可以看作是一个非定向子图G,有一组四个节点V和一组五条边E。\u003cbr\u003e\u003cbr\u003e如果$V\u003d(A,B,C,D)$和$E\u003d(AB,BC,CD,DA,AC)$相连,我们称G为一个“A-结构”。\u003cbr\u003e\u003cbr\u003e定义了只有在条件$V_1\u003dV_2$和$E_1\u003dE_2$下,“A-结构”$G_1\u003dV_1+E_1$和$G_2\u003dV_2+E_2$才相同。\u003cbr\u003e\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"不超过300个测试用例。\u003cbr\u003e\u003cbr\u003e对于每个测试用例,在第一行有2个正整数n和m。\u003cbr\u003e\u003cbr\u003e$2\\le n \\le 10^5$,$1 \\le m \\le min(2 \\times 10^5,\\frac{n(n-1)}{2})$\u003cbr\u003e\u003cbr\u003e然后是m行,每行有两个正整数u和v,表示这条边连接节点u和节点v。\u003cbr\u003e\u003cbr\u003e$1 \\leq u,v \\leq n$\u003cbr\u003e\u003cbr\u003e$\\sum{n} \\leq 3 \\times 10^5$,$\\sum{m} \\leq 6 \\times 10^5$\u003cbr\u003e"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,只需在一行中输出一个整数--一个不同的“A-结构”的数量。\u003cbr\u003e"}},{"title":"样例","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\u003e4 5\r\n1 2\r\n2 3\r\n3 4\r\n4 1\r\n1 3\r\n4 6\r\n1 2\r\n2 3\r\n3 4\r\n4 1\r\n1 3\r\n2 4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}