UVA13105 Alliances in Hogwarts

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=871&page=show_problem&problem=5016 [PDF](https://uva.onlinejudge.org/external/131/p13105.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13105/1908e4d4de8ce37a7b16f29a961ef815b12eb3aa.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13105/175a86e93ba0f96ae9d94b2a3b9b787f256d8669.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13105/92b932d8402d64c3419edea0a686a1cbeab269df.png)