UVA11767 World of Knots

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2867 [PDF](https://uva.onlinejudge.org/external/117/p11767.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11767/a6d885a16f2279d1f7c400f2b52621a5d4b1ff78.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11767/2795601d6dd2b0f47ff863732bab5d2813dfa9a4.png)

Output Format

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