UVA10689 Yet another Number Sequence

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1630 [PDF](https://uva.onlinejudge.org/external/106/p10689.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10689/768cfa40afe728dcfd1391737187a05d67a72359.png)

Input Format

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

Output Format

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