UVA818 切断圆环链 Cutting Chains

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=759 [PDF](https://uva.onlinejudge.org/external/8/p818.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA818/9588cba436e36fdf85fd844a054493144c71cd89.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA818/821cc5792a65cc72d2d0454f5be79a922e908729.png)

Output Format

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