{"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\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e 有$$$n$$$个城市被$$$m$$$条路连接,每条路都有一个最大承重能力$$$k$$$,如果货车总重量$$$p$$$大于$$$k$$$,则货车不能通过该条路。\u003c/p\u003e\n\u003cp\u003e如果一辆货车能从城市$$$x$$$一直开到$$$y$$$,则称城市$$$x,y$$$对于该货车而言是“互通的”。\u003c/p\u003e\n\u003cp\u003e现在每次询问给定一个数$$$p$$$表示货车总重量,请问有多少城市对于这辆货车是“互通的”?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e$$$T(1\\le T\\le 10)$$$组样例。\u003c/p\u003e\n\u003cp\u003e每组样例第一行包含三个整数$$$n,m,q(2\\le n\\le 1e5,1\\le m\\le 2e5,1\\le q\\le 2e5)$$$分别表示城市的数量,路的数量,以及询问的数量。\u003c/p\u003e\n\u003cp\u003e然后是$$$m$$$行,每行包含三个整数$$$x,y,k(1\\le x,y\\le n,1\\le k\\le 1e9)$$$表示城市$$$x,y$$$之间有一条直接相连的路,最大承重能力为$$$k$$$。\u003c/p\u003e\n\u003cp\u003e最后$$$q$$$行,每行一个整数$$$p(1\\le p\\le 1e9)$$$表示货车总重量。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e每组样例输出$$$q$$$行,每行包含一个整数,表示询问答案。\u003c/p\u003e"}},{"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\u003e1\n5 5 3\n1 2 2\n2 3 3\n3 4 1\n4 5 1\n5 1 3\n3\n2\n1\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\u003e2\n6\n10\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}