UVA10000 Longest Paths

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=941 [PDF](https://uva.onlinejudge.org/external/100/p10000.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10000/4538b0cef0adfb85facbc29db424a374cbf36a38.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10000/f36fa5f12ef82970ee2351e33f0fc1260e048c97.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10000/54d942a79ecf6ae3369bfc2d929dab888b20b285.png)