ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


160. 50301 - Fractions to Decimals

Гость
• Обсуждение задачи (1)

Задачи сборника

• 50687 - Pascal Triangle - 2
• 50342 - 100 Factorial
• 50337 - Exam Averages
• 51149 - One Piece Arena
• 50558 - Hangari i madh [USACO FA...
• 50567 - Normalizimi Min Max
• 50769 - Ku eshte Waldorf?
• 151. 50557 - Fuqia e N-te e M(Shu...
• 160. 50301 - Fractions to Deci...
• 165. 50360 - National Elections
• 170. 50319 - Toll Plazas
• 210. 50361 - Align Two Lists

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared from USACO. Сложность Гамма

Fractions to Decimals

USACO

Write a program that will accept a fraction of the form N/D, where N is the numerator and D is the denominator 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. Typical conversions are:

   1/3 = 0.(3)
   22/5 = 4.4
   1/7 = 0.(142857)
   2/4 = 0.5
   3/8 = 0.375
   45/56 = 0.803(571428)

INPUT FORMAT
A single line with two space separated integers, N and D, 1 ≤ N < D ≤ 100000.

OUTPUT FORMAT
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 I
45 56
Sample Output 1
0.803(571428)

Для отправки решений необходимо выполнить вход.

www.contester.ru