UVA935 Smart Strategy

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=876 [PDF](https://uva.onlinejudge.org/external/9/p935.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA935/134f7f18fe4047054279ea9856c530bdc6cc98f9.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA935/732e72fab9812c5b303b3747b127f8b07dddcad9.png)

Output Format

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