UVA10058 Jimmi's Riddles

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=999 [PDF](https://uva.onlinejudge.org/external/100/p10058.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10058/c9886178ef5a8449cf478c9d086998fb28c8b54d.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10058/20ef815532f2b1c0f3b079c9519901a4db8daeec.png)