UVA10720 Graph Construction

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1661 [PDF](https://uva.onlinejudge.org/external/107/p10720.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10720/a2dfcfde48a0ccc0924045380ded321f9bddbadb.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10720/79d7a33b2bcbcadd026dc1c9700bf4f93163df41.png)