This page is still under construction.

Parts of this page are still being built. What you see may change.

Do you like fractions?

Time limit2sMemory limit256 MB

Summary
Convert each fraction to a mixed number by printing the quotient, the remainder, and the original denominator without reducing.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

You are writing the part of a basic math tutor that prints a fraction as a mixed number.

A proper fraction has a numerator smaller than its denominator. A mixed number splits off the whole part and writes what is left as a proper fraction. For a fraction with numerator nn and denominator dd, the whole part is the quotient q=⌊n/d⌋q = \lfloor n / d \rfloor and the numerator of the leftover fraction is the remainder r=n mod dr = n \bmod d. For example, 27/1227/12 becomes the whole part 22 and the proper fraction 3/123/12.

Do not reduce the fraction. Printing 1/41/4 in place of 3/123/12 is wrong.

Input

The input has several lines, and each line is one test case. Each line holds two integers separated by a space. The first is the numerator nn and the second is the denominator dd. Both are between 11 and 231−12^{31} - 1.

Input ends on the line 0 0. That line is not a test case, so do not process it.

Output

For each test case, print the mixed number on one line. Print the whole part, the numerator of the leftover fraction, the character /, and the denominator, in that order, separated by single spaces.

Print a whole part of 00 or a remainder of 00 as it is. For numerator 33 and denominator 40004000, print 0 3 / 4000. For numerator 24600002460000 and denominator 9840098400, print 25 0 / 98400.

Examples7

  1. Example 1

    Input
    27 12
    2460000 98400
    3 4000
    0 0
    
    Expected output
    2 3 / 12
    25 0 / 98400
    0 3 / 4000
    
  2. Example 2

    Input
    1 1
    0 0
    
    Expected output
    1 0 / 1
    
  3. Example 3

    Input
    2147483647 1
    0 0
    
    Expected output
    2147483647 0 / 1
    
  4. Example 4

    Input
    1 2147483647
    0 0
    
    Expected output
    0 1 / 2147483647
    
  5. Example 5

    Input
    2147483647 2
    2147483646 2
    2147483647 2147483647
    2147483646 2147483647
    0 0
    
    Expected output
    1073741823 1 / 2
    1073741823 0 / 2
    1 0 / 2147483647
    0 2147483646 / 2147483647
    
  6. Example 6

    Input
    4 8
    8 4
    6 4
    100 10
    99 100
    0 0
    
    Expected output
    0 4 / 8
    2 0 / 4
    1 2 / 4
    10 0 / 10
    0 99 / 100
    
  7. Example 7

    Input
    5 5
    10 5
    11 5
    9 5
    1 5
    0 0
    
    Expected output
    1 0 / 5
    2 0 / 5
    2 1 / 5
    1 4 / 5
    0 1 / 5