Girls' Celebration
题目描述
[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=229&page=show_problem&problem=3144
[PDF](https://uva.onlinejudge.org/external/119/p11993.pdf)
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11993/a21155236859d5bf6e5dcf24b64499fef2b6b7e6.png)
输入输出格式
输入格式
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11993/892fe6e01740d8738e53dcc6bba6d97a81def8bc.png)
输出格式
![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11993/737c5c35a80fbab597de69ebe9ee07bc067b49b4.png)
输入输出样例
输入样例 #1
4 4 10
1 2 3 0
2 3 4 0
1 4 0
2 4 0
输出样例 #1
12
4
1 2 3 4
1 3 2 4
4 2 3 1
4 3 2 1
0
2
1 3 2 4
4 2 3 1