UVA10586 Polynomial Remains

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1527 [PDF](https://uva.onlinejudge.org/external/105/p10586.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10586/1449cf570f8d15ae08a63ccbb169c03fd6cffa26.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10586/8d8bcdf893db8e9fa16d1bd05d2b13484aab54d8.png)

Output Format

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