UVA11036 Eventually Periodic Sequence

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=22&page=show_problem&problem=1977 [PDF](https://uva.onlinejudge.org/external/110/p11036.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11036/17c9059e79297aa7aecc9a418baeca8c838491a3.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11036/51dcd36537c0c95d887edd3af9d9de1df8bcb09a.png)