UVA689 Napoleon's Grumble

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=630 [PDF](https://uva.onlinejudge.org/external/6/p689.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA689/66600733f7758c08dc0d233d14a596c8e82c9f7c.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA689/7fb3fc62c88e4192cf1085e15e05ec5d7877dcf6.png)