{"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":"HTML","content":"牛仔超又在E1530偷偷学习,一群仰望他的人(比如苗某)就来跟他一起学感受强者的力量。假设不同的机器可以靠网线连接,网线是双向的,但是同一时间,一根网线只能朝着一个方向运输信息。为了防止被别人偷看到某些不可描述的信息,没有两条网线交叉或重叠。把每条电脑看成xy平面坐标系上的点,x坐标由西向东增加,y由南向北增加。假设牛仔超坐在最东边,你坐在最西边,你想要偷偷跟他表白,为了表达诚意你想尽可能多的发送信息,你最多能发多少信息?"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入一个T表示测试数据数量\u003cbr\u003e第二行输入一个N和M(2\u003c\u003dN,M\u003c\u003d100000)分别表示机器数量和网线数量。\u003cbr\u003e接下来N行每行输入x和y表示第i个机器的位置,绝对值不大于100000\u003cbr\u003e接下来m行说明第i个机器可以传给第j个机器多少信息。\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"输出你能发出的最多信息"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n5 7\n3 3\n3 0\n3 1\n0 0\n4 5\n1 3 3\n2 3 4\n2 4 3\n1 5 6\n4 5 3\n1 4 4\n3 4 2\n6 7\n-1 -1\n0 1\n0 2\n1 0\n1 1\n2 3\n1 2 1\n2 3 6\n4 5 5\n5 6 3\n1 4 6\n2 5 5\n3 6 4\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e9\n6\u003c/pre\u003e"}}]}