#K56972. Fraction to Decimal Representation

    ID: 30317 Type: Default 1000ms 256MiB

Fraction to Decimal Representation

Fraction to Decimal Representation

Given two integers representing the numerator and denominator of a fraction, convert the fraction to its decimal representation as a string. If the fractional part contains repeating decimals, enclose the repeating part in parentheses.

The result should handle negative numbers as well as the absence of a fractional part. For example, for input 2 and 3 the output should be "0.(6)", and for input -50 and 8 the output should be "-6.25".

Note: If the decimal representation terminates, do not include any parentheses.

inputFormat

The input is provided via standard input (stdin) and consists of two space-separated integers: the numerator and the denominator.

Example: 1 2

outputFormat

The output should be printed to standard output (stdout) as a single string representing the decimal conversion of the input fraction. Repeating decimals must be enclosed in parentheses.

Example: 0.5

## sample
1 2
0.5