{"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":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n陵墓由N间房间构成,房间之间有通道存在,从一间房间到另外一间相邻的房间需要花费一定的时间经过通道,并且每间房间都有一定数量的财宝,现在hm位于第1间房,出口在第N间,突然陵墓快要倒塌了,hm想知道自己能在T时间内拿到多少财宝并逃出陵墓。\n \u003cbr\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are multiple test cases.\n\u003cbr\u003eThe first line contains two integer N and T. (1 \u0026lt;\u003d n \u0026lt;\u003d 100, 0 \u0026lt;\u003d T \u0026lt;\u003d 500)\n\u003cbr\u003eEach of the next N - 1 lines contains three integers a, b, and t indicating there is a road between a and b which costs t minutes. (1\u0026lt;\u003da\u0026lt;\u003dn, 1\u0026lt;\u003db\u0026lt;\u003dn, a!\u003db, 0 \u0026lt;\u003d t \u0026lt;\u003d 100)\n\u003cbr\u003eThe last line contains N integers, which Ai indicating the number of treasure in the ith room. (0 \u0026lt;\u003d Ai \u0026lt;\u003d 100)\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output an integer indicating the maximum number of treasures I can take out in T minutes; if I cannot get out of the tomb, please output \"Human beings die in pursuit of wealth, and birds die in pursuit of food!\".\n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e5 10\n1 2 2 \n2 3 2\n2 5 3\n3 4 3\n1 2 3 4 5\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e11\u003c/pre\u003e"}}]}