G |
Working with Small Numbers |
|
Input: Standard Input Output: Standard Output |
|
Or in other words if , then you will have to find the values of a and b. Here a and b are two relative prime integers. The values of a and b will not always fit even in a 64-bit unsigned integer.
The input file contains 2000 lines of inputs. Each line contains two integers which denotes the values of m and n () respectively. Input is terminated by a line containing two zeroes. This line should not be processed.
For each line of input produce four lines of outputs. The descriptions of these four lines are given below:
The first line of each set contains the serial of output. Next line prints out the value of a, the third line contains the dividing line of the fraction and the fourth line contains the value of b. The length of the dividing line is equal to the length of b.
Print a blank line after the output of each set of input.
30
30 3
5 0
0 |
Case
1: 29757025 ---------- 9644811264 Case
2: 209 ----- 72576 |
Problemsetter: Shahriar Manzoor
Special Thanks: Derek Kisman