UVA12197 Trick or Treat

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=243&page=show_problem&problem=3349 [PDF](https://uva.onlinejudge.org/external/121/p12197.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12197/0273ebed72db3ae776e2e6bd6fc16b95ddc37dd8.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12197/3b631320829f8c3e21ec4b8d18b211d08ca120dc.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12197/4dd8fc1d9b52ada5429c27a877205c8f7d7689f8.png)