UVA10778 Mathemagicland

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1719 [PDF](https://uva.onlinejudge.org/external/107/p10778.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10778/7cf0708f3de94189f3f73f8a04c0c9da68bc101c.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10778/0e785a9165a1a26735e1a921b42800dc72bfd651.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10778/5086ee779eac026e8dba73924fe97b8d8176cd61.png)