UVA879 Circuit Nets

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=820 [PDF](https://uva.onlinejudge.org/external/8/p879.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA879/68499db849a824c779946eb45b67ed5f6b5c99da.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA879/6cdf41ec6dea98ff0d78e04efbd0a8640e43f9fe.png)