UVA11042 Complex, difficult and complicated

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=22&page=show_problem&problem=1983 [PDF](https://uva.onlinejudge.org/external/110/p11042.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11042/71aea34e490bce839b48d6d56bf4ad0eddd7c0e4.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11042/1ba097d49a8f1ed0b7932b199948db7f3b90d229.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11042/2af253bf6690d92c118de8bf07b4a30182b1c649.png)