提示: 欢迎访问OurACM平台。
Problem 1846 Circulator

Accept: 38    Submit: 146
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Give you a integer N and a integer D,your task is to calculate N/d and print the decimal representation. If the decimal representation has a repeating sequence of digits, indicate the sequence by enclosing it in brackets. For example, 1/3 = .33333333...is denoted as 0.(3), and 41/333 = 0.123123123...is denoted as 0.(123). Use xxx.0 to denote an integer.

For example:

1/3=0.(3)

22/5=4.4

1/7=0.(142857)

2/2=1.0

3/8=0.375

45/56=0.803(571428)

Input

The input consists of several test cases. Each case contains a line with two positive numbers N and D. 1 <= N,D <= 100000

Output

For each case, output the decimal expansion, as detailed above. If the expansion exceeds 76 characters in length, print it on multiple lines with 76 characters per line.

Sample Input

1 7

Sample Output

0.(142857)

Source

FOJ有奖月赛-2009年10月——稚鹰翱翔

Submit  Back  Status  Discuss