UVA10984 Double NP-hard

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1925 [PDF](https://uva.onlinejudge.org/external/109/p10984.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10984/47d6f7eea4856df56869ec474050a956a0727769.png)

Input Format

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

Output Format

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