UVA10254 The Priest Mathematician

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1195 [PDF](https://uva.onlinejudge.org/external/102/p10254.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10254/fe22f3b0f95ef2ee256d7540ef5c4e0464f211cb.png)

Input Format

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

Output Format

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