UVA10077 The Stern-Brocot Number System

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1018 [PDF](https://uva.onlinejudge.org/external/100/p10077.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10077/8bc34cd136b6f0e6f5880bcb2b905ade7f53b672.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10077/7500f287c2a7fd62accdbb423dae1e7c7e59038d.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10077/120f48b37f3dab02d44baec94840c9156baf8a66.png)