{"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\"\u003eAfter trying hard for many years, Victor has finally received a pilot license. To have a celebration, he intends to buy himself an airplane and fly around the world. There are $n$ countries on the earth, which are numbered from $1$ to $n$. They are connected by $m$ undirected flights, detailedly the $i$-th flight connects the $u_i$-th and the $v_i$-th country, and it will cost Victor\u0027s airplane $w_i$ L fuel if Victor flies through it. And it is possible for him to fly to every country from the first country.\u003cbr\u003e\u003cbr\u003eVictor now is at the country whose number is $1$, he wants to know the minimal amount of fuel for him to visit every country at least once and finally return to the first country.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input contains an integer $T$, denoting the number of test cases.\u003cbr\u003eIn every test case, there are two integers $n$ and $m$ in the first line, denoting the number of the countries and the number of the flights.\u003cbr\u003e\u003cbr\u003eThen there are $m$ lines, each line contains three integers $u_i$, $v_i$ and $w_i$, describing a flight.\u003cbr\u003e\u003cbr\u003e$1\\leq T\\leq 20$.\u003cbr\u003e\u003cbr\u003e$1\\leq n\\leq 16$.\u003cbr\u003e\u003cbr\u003e$1\\leq m\\leq 100000$.\u003cbr\u003e\u003cbr\u003e$1\\leq w_i\\leq 100$.\u003cbr\u003e\u003cbr\u003e$1\\leq u_i, v_i \\leq n$."}},{"title":"Output","value":{"format":"HTML","content":"Your program should print $T$ lines : the $i$-th of these should contain a single integer, denoting the minimal amount of fuel for Victor to finish the travel."}},{"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\u003e1\r\n3 2\r\n1 2 2\r\n1 3 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e10\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}