(int u)
| 288 | } |
| 289 | |
| 290 | public static long solve(int u) { |
| 291 | vis[u] = true; |
| 292 | long ans = calc(u); |
| 293 | for (int e = head[u]; e > 0; e = nxt[e]) { |
| 294 | int v = to[e]; |
| 295 | if (!vis[v]) { |
| 296 | ans = Math.max(ans, solve(getCentroid(v, u))); |
| 297 | } |
| 298 | } |
| 299 | return ans; |
| 300 | } |
| 301 | |
| 302 | public static void main(String[] args) throws Exception { |
| 303 | FastReader in = new FastReader(System.in); |
no test coverage detected