UVA10785 The Mad Numerologist

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10785/2ad52448bf14873d4d06d2ec572222dd7ecb79e1.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10785/941059b5a6c3e85e86ab6c2d641d012f26bbe78f.png)