Type: RemoteJudge 1000ms 125MiB

[USACO2.4] 分数化小数 Fractions to Decimals

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

写一个程序,输入一个形如 ND\dfrac{N}{D} 的分数,输出它的小数形式。如果小数有循环节的话,把循环节放在一对圆括号中。

例如,13=0.33333333\dfrac{1}{3}=0.33333333\ldots 写成 0.(3)0.(3)41333=0.123123123\dfrac{41}{333}= 0.123123123\ldots 写成 0.(123)0.(123),整数 xx 写成 x.0x.0

输入格式

输入包含两个整数 NNDD1N,D1051 \leq N,D \leq 10^5)。

输出格式

输出按照上面规则计算出的小数表达式。如果结果长度大于 7676,每行输出 7676 个字符。

45 56
0.803(571428)

提示

翻译来自NOCOW

USACO 2.4

入门作业2

Not Claimed
Status
Done
Problem
18
Open Since
2026-2-5 0:00
Deadline
2026-2-25 0:00
Extension
24 hour(s)