시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 297 81 71 30.085%

문제

분수는 소수로 바꿀 수 있다. 예를 들어, \(\frac{1}{2}\)는 \(0.5\)이고, \(\frac{1}{3}\)은 \(0.333\dots \)이며, 간단하게 \(0.\overline { 3 } \)으로 쓴다. \(0.5\)는 길이가 유한하지만, \(0.\overline { 3 } \)는 반복된다. 아래는 분수를 순환 소수로 나타낸 예시이다.

\[\frac{2}{7} = 0.\overline{285714} \\ \frac{17}{66} = 0.25\overline{75} \\ \frac {25}{6} = 4.1\overline{6} \\ \frac{3401}{333} = 10.\overline{213}\]

순환 소수가 주어졌을 때, 분수로 바꾸는 프로그램을 작성하시오. 분자와 분모는 서로소이어야 한다.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 순환 소수 하나로 이루어져 있으며, 반복되는 부분은 괄호로 감싸져 있다. 각 소수에 있는 숫자의 개수는 최대 9개이다.

출력

입력으로 주어진 소수마다 분수를 출력한다. 분자와 분모는 서로소이어야 한다.

예제 입력 1

0.(285714)
0.25(75)
4.1(6)

예제 출력 1

0.(285714) = 2 / 7
0.25(75) = 17 / 66
4.1(6) = 25 / 6
W3sicHJvYmxlbV9pZCI6Ijk3MzQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyMWNcdWQ2NTggXHVjMThjXHVjMjE4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWJkODRcdWMyMThcdWIyOTQgXHVjMThjXHVjMjE4XHViODVjIFx1YmMxNFx1YWZjMCBcdWMyMTggXHVjNzg4XHViMmU0LiBcdWM2MDhcdWI5N2MgXHViNGU0XHVjNWI0LCBcXChcXGZyYWN7MX17Mn1cXClcdWIyOTQgXFwoMC41XFwpXHVjNzc0XHVhY2UwLCBcXChcXGZyYWN7MX17M31cXClcdWM3NDAgXFwoMC4zMzNcXGRvdHMgXFwpXHVjNzc0XHViYTcwLCBcdWFjMDRcdWIyZThcdWQ1NThcdWFj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