UVA834 Continued Fractions

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=775 [PDF](https://uva.onlinejudge.org/external/8/p834.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA834/eda13945311235b15e24d20233fdc14b33d68e8f.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA834/29138a6b113a3e4d9eeeb4aecd16548d34902a89.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA834/3875b660a097cb5858be29638069befc0b39da13.png)