UVA12158 Irreducible Fractions

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=243&page=show_problem&problem=3310 [PDF](https://uva.onlinejudge.org/external/121/p12158.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12158/fbe3e1bd27cddc461d3906260cf81afe42ff7661.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12158/1110b866b8fdb636735eec37d73f821e3ffeab44.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12158/3d83ff833c9d4aac5ecfba037b405b554b58fe4b.png)