UVA988 Many Paths, One Destination

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=929 [PDF](https://uva.onlinejudge.org/external/9/p988.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA988/70819fc9e92d591d99778e6c669b7d400d30d00f.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA988/1c14d3a996b1303b14b5da346beebf96751a774d.png)