UVA12720 Algorithm of Phil

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=823&page=show_problem&problem=4572 [PDF](https://uva.onlinejudge.org/external/127/p12720.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12720/db969966d7870bc0f4f2b7f1e9cf4e7dd1a95761.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12720/1031082fb0ea5d30524a6256a87ee4f53ffbe9c8.png)

Output Format

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