UVA10754 Fantastic Sequence

Description

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

Input Format

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

Output Format

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