UVA11773 King's Wish

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2873 [PDF](https://uva.onlinejudge.org/external/117/p11773.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11773/eb57231cfdd80fcbed14bc685d8c582bfa0bd48d.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11773/392c10147eb240b475916eca0a8b8a6af99d784b.png)

Output Format

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