{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003e树木是自然景观中的重要组成部分,因为它们可以防止侵蚀,并在它们的叶片上方和下方提供一个特定的庇护生态系统。树木还被发现在产生氧气、减少大气中的二氧化碳以及调节地面温度方面起着重要作用。它们在园林和农业中也是重要的元素,既因为它们的美学吸引力,也因为它们的果园作物(比如苹果)。树木木材是一种常见的建筑材料。\u003c/p\u003e\u003cp\u003e树木还在世界许多神话中扮演着亲密的角色。许多学者对树木的特殊属性很感兴趣,比如树的中心、树的计数、树的着色。A(\u003ci\u003ex\u003c/i\u003e)就是这样一种属性。\u003c/p\u003e\u003cp\u003eA(\u003ci\u003ex\u003c/i\u003e)(节点 \u003ci\u003ex\u003c/i\u003e 的累积度)定义如下:\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003col\u003e\u003cli\u003e树的每条边都有一个正的容量。\u003c/li\u003e\u003cli\u003e树中度为一的节点被称为终端节点。\u003c/li\u003e\u003cli\u003e每条边的流量不能超过其容量。\u003c/li\u003e\u003cli\u003e\u003ci\u003eA\u003c/i\u003e(\u003ci\u003ex\u003c/i\u003e) 是节点 \u003ci\u003ex\u003c/i\u003e 能够流向其他终端节点的最大流量。\u003c/li\u003e\u003c/ol\u003e\u003cp\u003e由于定义可能难以理解,下面展示了一个例子:\u003c/p\u003e\u003cp\u003e\u003cimg src\u003d\"CDN_BASE_URL/68817933e8e32f44410dadbf657a6ea2?v\u003d1705826427\"\u003e\u003c/p\u003e\r\u003cbr\u003e\t\u003ctable border\u003d\"0\" width\u003d\"69%\" id\u003d\"table1\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd colspan\u003d\"3\"\u003eA(1)\u003d11+5+8\u003d24\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003eDetails:\u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e2\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e11\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003e \u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e3\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e5\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003e \u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e5\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e8(因为1\u003cb\u003e-\u0026gt;\u003c/b\u003e4的容量为13)\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"97%\" colspan\u003d\"3\"\u003eA(2)\u003d5+6\u003d11\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003eDetails:\u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e2\u003cb\u003e-\u0026gt;\u003c/b\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e3\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e5\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003e \u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e2\u003cb\u003e-\u0026gt;\u003c/b\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e5\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e6\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"97%\" colspan\u003d\"3\"\u003eA(3)\u003d5\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003eDetails: \u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e3\u003cb\u003e-\u0026gt;\u003c/b\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e5\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e5\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"97%\" colspan\u003d\"3\"\u003eA(4)\u003d11+5+10\u003d26\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003eDetails:\u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e2\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e11\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003e \u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e3\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e5\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003e \u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e5\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e10\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"97%\" colspan\u003d\"3\"\u003eA(5)\u003d10\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd width\u003d\"15%\"\u003eDetails:\u003c/td\u003e\u003ctd width\u003d\"19%\"\u003e5\u003cb\u003e-\u0026gt;\u003c/b\u003e4\u003cb\u003e-\u0026gt;\u003c/b\u003e1\u003cb\u003e-\u0026gt;\u003c/b\u003e2\u003c/td\u003e\u003ctd width\u003d\"63%\"\u003e10\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003cp\u003e树的累积度是其节点中的最大累积度。你的任务是找出给定树的累积度。\u003c/p\u003e\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行是一个整数 \u003ci\u003eT\u003c/i\u003e,表示测试用例的数量。每个测试用例的第一行是一个正整数 \u003ci\u003en\u003c/i\u003e。接下来的 \u003ci\u003en\u003c/i\u003e - 1 行中,每行包含三个用空格分隔的整数 \u003ci\u003ex\u003c/i\u003e、\u003ci\u003ey\u003c/i\u003e、\u003ci\u003ez\u003c/i\u003e,表示节点 \u003ci\u003ex\u003c/i\u003e 和节点 \u003ci\u003ey\u003c/i\u003e 之间有一条边,边的容量为 \u003ci\u003ez\u003c/i\u003e。节点从1到 \u003ci\u003en\u003c/i\u003e 编号。\u003cbr\u003e所有元素都是不超过200000的非负整数。你可以假设测试数据都是树度量。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,将结果输出在一行上。 \u003cbr\u003e \u003c/p\u003e"}},{"title":"样例","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\n5\r\n1 2 11\r\n1 4 13\r\n3 4 5\r\n4 5 10\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e26\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}