UVa 880 - Cantor Fractions

880 - Cantor Fractions

 * http://acm.uva.es/p/v8/880.html

Summary
Like 264 http://www.algorithmist.com/index.php/UVa_264

Input
1 3 14 7 10000000

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