UVA13253 Rational Coins

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=878&page=show_problem&problem=5176 [PDF](https://uva.onlinejudge.org/external/132/p13253.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13253/decfc7075fc027bd9ef52ddcb657044886cbc746.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13253/83e2473410b7638217ac20cc2ff1d43910a3b981.png)

Output Format

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