UVA11306 Optimal Marriage on Planet X

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2281 [PDF](https://uva.onlinejudge.org/external/113/p11306.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11306/735e01b0ed0c9fb6ec60bea241ffdaca140cc1a1.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11306/0bddae6e1e1cee56aa29d0dfb5d2573745e207f4.png)