{"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\"\u003eLong times ago, there are beautiful historic walls in the city. These walls divide the city into many parts of area. \u003cbr\u003e\u003cbr\u003eSince it was not convenient, the new king wants to destroy some of these walls, so he can arrive anywhere from his castle. We assume that his castle locates at $(0.6*\\sqrt 2 , 0.6*\\sqrt 3 )$. \u003cbr\u003e\u003cbr\u003eThere are $n$ towers in the city, which numbered from 1 to n. The ith\u0027s location is $(x_i,y_i)$. Also, there are m walls connecting the towers. Specifically, the ith wall connects the tower $u_i$ and the tower $v_i$(including the endpoint). The cost of destroying the ith wall is $w_i$. \u003cbr\u003e\u003cbr\u003eNow the king asks you to help him to divide the city. Firstly, the king wants to destroy as less walls as possible, and in addition, he wants to make the cost least. \u003cbr\u003e\u003cbr\u003eThe walls only intersect at the endpoint. It is guaranteed that no walls connects the same tower and no 2 walls connects the same pair of towers. Thait is to say, the given graph formed by the walls and towers doesn\u0027t contain any multiple edges or self-loops.\u003cbr\u003e\u003cbr\u003eInitially, you should tell the king how many walls he should destroy at least to achieve his goal, and the minimal cost under this condition.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases.\u003cbr\u003e\u003cbr\u003eFor each test case:\u003cbr\u003e\u003cbr\u003eThe first line contains 2 integer n, m.\u003cbr\u003e\u003cbr\u003eThen next n lines describe the coordinates of the points.\u003cbr\u003e\u003cbr\u003eEach line contains 2 integers $x_i,y_i$. \u003cbr\u003e\u003cbr\u003eThen m lines follow, the ith line contains 3 integers $u_i,v_i,w_i$\u003cbr\u003e\u003cbr\u003e$|x_i|,|y_i|\\le 10^5$\u003cbr\u003e\u003cbr\u003e$3\\le n \\le 100000,1\\le m \\le 200000$\u003cbr\u003e\u003cbr\u003e$1\\le u_i,v_i\\le n ,u_i\\ne v_i ,0\\le w_i \\le 10000$\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case outout one line with 2 integers sperate by a space, indicate how many walls the king should destroy at least to achieve his goal, and the minimal cost under this condition. \u003cbr\u003e"}},{"title":"Sample","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 4\r\n-1 -1\r\n-1 1\r\n1 1\r\n1 -1\r\n1 2 1\r\n2 3 2\r\n3 4 1\r\n4 1 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}