埃及分数 Egyptian Fractions (HARD version)

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=441&page=show_problem&problem=4003 [PDF](https://uva.onlinejudge.org/external/125/p12558.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12558/2fc37ee6f550acb8454e29913ccfe23a1f41eb0d.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12558/5a94c57de75f98b0a34639ef7564b7a9cea5c867.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12558/7fe59f3b33b2daeb677a84f7225aed07bae84794.png)

输入输出样例

输入样例 #1

5
2 3 0
19 45 0
2 3 1 2
5 121 0
5 121 1 33

输出样例 #1

Case 1: 2/3=1/2+1/6
Case 2: 19/45=1/5+1/6+1/18
Case 3: 2/3=1/3+1/4+1/12
Case 4: 5/121=1/33+1/121+1/363
Case 5: 5/121=1/45+1/55+1/1089