UVA12665 Joking with Fermat's Last Theorem

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=602&page=show_problem&problem=4403 [PDF](https://uva.onlinejudge.org/external/126/p12665.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12665/bd40a52c0b1e916efd8c8b04c684738246059115.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12665/7a237dc0af85d09a445b9f70a140a43112b133c5.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12665/64a487be03a98e02c5d5cc0b2fc5073a70432d64.png)