UVa 880 - Cantor Fractions

Summary
Similar to UVa 264

Input
1 3 14 7 10000000

Output
1/1 1/2 2/4 4/1 1629/2844