UVA12370 Game of Connect

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=278&page=show_problem&problem=3792 [PDF](https://uva.onlinejudge.org/external/123/p12370.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12370/f593c229d5eedcea8f15c234424c265161efc352.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12370/56038f8902e3aef52bdc17c6ede909fe9f1893a5.png)

Output Format

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