UVA11202 The least possible effort

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2143 [PDF](https://uva.onlinejudge.org/external/112/p11202.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11202/0ec334c3e5bb811d170eff50515890712edd907a.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11202/9b44d031bd7e4c08cf4e65cfe58fb70f5ef98f01.png)