{"trustable":false,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"在2维平面下,给n条线l1,l2 ... ln。\u003c/p\u003e现在好奇宝宝HJ想知道,有几个数对(i,j)满足1\u003c\u003di \u003c j \u003c\u003d n,且li和lj至少有一个交点呢?"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入T,表示有T组。(T \u003c\u003d 1, 000)\u003c/p\u003e\n第二行输入n表示有n条线。(n \u003c\u003d 100,000)\u003c/p\u003e\n接下来n行,每行输入Xa,Ya,Xb,Yb。(X,Y 的绝对值 \u003c\u003d 1, 000, 000, 000) \u003c/p\u003e\n这意味着li 通过了 ( Xa,Ya ) 和(Xb ,Yb) \u003c/p\u003e\n保证 ( Xa,Ya ) 和(Xb ,Yb) 永远不同。\n保证n的总和小于10的6次方"}},{"title":"Output","value":{"format":"HTML","content":"对于每组数据,输出单独的一行表示答案。"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3\n2\n0 0 1 1\n0 1 1 0\n2\n0 0 0 1\n1 0 1 1\n2\n0 0 1 1\n0 0 1 1\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1\n0\n1\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}