UVA11598 Optimal Segments

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=27&page=show_problem&problem=2645 [PDF](https://uva.onlinejudge.org/external/115/p11598.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11598/cc13188bcde9e663e48f2040332b45867dbc2b5d.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11598/84a48c8616f7edcc0d9a57ae8238ea3f8e58f274.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11598/6888e27d7402ced923e10e766971417a84daf00c.png)