UVA10581 Partitioning for fun and profit

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1522 [PDF](https://uva.onlinejudge.org/external/105/p10581.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10581/b3d0b955c8198ca52b3d5f4526fecbfc0e781b15.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10581/0134999d13079fa7be73f55a611ce474f75bdc18.png)