Repeating Decimal

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Each line of input contains a fraction.
Translate the fraction into decimal in the following format.

**integer
10/2 => 5

**finite decimal
10/4 => 2.5

**repeating decimal
10/3 (= 3.33333...) => 3.(3)
10/7 (= 1.428571428571...) =>1.(428571)
10/44 (= 0.227272727...) => 0.2(27)

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

1/1
2/2
3/3
4/4
4/2
9/3
16/4
1/2
3/2
1/4
2/4
3/4
5/4
6/4
1/5
2/5
3/5
4/5
6/5
7/5
1/3
2/3
4/3
5/3
1/6
2/6
5/6
7/6
9/6
1/7
2/7
3/7
4/7
5/7
6/7
1/11
3/11
3/13
5/13
1/21
22/21
333/21
2/143
44/143
113/355
355/113

Sample output:

1
1
1
1
2
3
4
0.5
1.5
0.25
0.5
0.75
1.25
1.5
0.2
0.4
0.6
0.8
1.2
1.4
0.(3)
0.(6)
1.(3)
1.(6)
0.1(6)
0.(3)
0.8(3)
1.1(6)
1.5
0.(142857)
0.(285714)
0.(428571)
0.(571428)
0.(714285)
0.(857142)
0.(09)
0.(27)
0.(230769)
0.(384615)
0.(047619)
1.(047619)
15.(857142)
0.(013986)
0.(307692)
0.3(18309859154929577464788732394366197)
3.(1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168)

Sample input:_

383/386
277/415
293/335
386/492
149/421
362/27
190/59
263/426
40/426
172/236
211/368
67/429
282/30
362/123
67/135
429/302
22/58
175/7
69/167
393/456
11/42
229/373
421/419
284/37
198/324
315/370
413/26
91/480
456/373
362/170
496/281
305/425
84/327
336/5
346/229
313/357
124/395
82/45
314/367
434/364
43/250
87/308
276/178
288/84
403/151
254/399
432/60
176/368
239/12
226/86
94/39
295/70
434/378
467/101
97/402
317/492
152/256
301/280
286/441
365/189
444/119
440/229
31/117
97/271
481/175
209/427
67/356
497/353
86/465
306/183
219/124
28/371
232/329
3/19
270/368
208/215
340/149
296/223
118/245
346/451
421/55
379/488
264/228
341/350
34/264
124/414
487/356
243/491
227/365
359/436
432/51
437/228
275/407
474/121
358/395
29/237
235/293
318/428
143/11
428/29
276/404

Sample output:

0.9(922279792746113989637305699481865284974093264248704663212435233160621761658031088082901554404145077720207253886010362694300518134715025906735751295336787564766839378238341968911917098445595854)
0.6(67469879518072289156626506024096385542168)
0.8(746268656716417910447761194029850)
0.7(84552)
0.(35391923990498812351543942992874109263657957244655581947743467933491686460807600950118764845605700712589073634204275534441805225653206650831)
13.(407)
3.(2203389830508474576271186440677966101694915254237288135593)
0.6(17370892018779342723004694835680751)
0.(09389671361502347417840375586854460)
0.(7288135593220338983050847457627118644067796610169491525423)
0.5733(6956521739130434782608)
0.(156177)
9.4
2.(94308)
0.4(962)
1.4(205298013245033112582781456953642384105960264900662251655629139072847682119)
0.(3793103448275862068965517241)
25
0.(4131736526946107784431137724550898203592814371257485029940119760479041916167664670658682634730538922155688622754491017964071856287425149700598802395209580838323353293)
0.861(842105263157894736)
0.2(619047)
0.(613941018766756032171581769436997319034852546916890080428954423592493297587131367292225201072386058981233243967828418230563002680965147453083109919571045576407506702412868632707774798927)
1.(0047732696897374701670644391408114558472553699284009546539379474940334128878281622911694510739856801909307875894988066825775656324582338902147971360381861575178997613365155131264916467780429594272076372315035799522673031026252983293556085918854415274463007159904534606205250596658711217183770883054892601431980906921241050119331742243436754176610978520286396181384248210023866348448687350835322195704057279236276849642)
7.(675)
0.6(1)
0.8(513)
15.8(846153)
0.18958(3)
1.(222520107238605898123324396782841823056300268096514745308310991957104557640750670241286863270777479892761394101876675603217158176943699731903485254691689008042895442359249329758713136729)
2.1(2941176470588235)
1.(7651245551601423487544483985)
0.7(1764705882352941)
0.(256880733944954128440366972477064220183486238532110091743119266055045871559633027522935779816513761467889908)
67.2
1.(510917030567685589519650655021834061135371179039301310043668122270742358078602620087336244541484716157205240174672489082969432314410480349344978165938864628820960698689956331877729257641921397379912663755458515283842794759825327)
0.(876750700280112044817927170868347338935574229691)
0.3(1392405063291)
1.8(2)
0.(855585831062670299727520435967302452316076294277929155313351498637602179836512261580381471389645776566757493188010899182561307901907356948228882833787465940054495912806539509536784741144414168937329700272479564032697547683923705722070844686648501362397820163487738419618528610354223433242506811989100817438692098092643051771117166212534059945504087193460490463215258)
1.1(923076)
0.172
0.28(246753)
1.(55056179775280898876404494382022471910112359)
3.(428571)
2.(668874172185430463576158940397350993377483443708609271523178807947019867549)
0.(636591478696741854)
7.2
0.(4782608695652173913043)
19.91(6)
2.(627906976744186046511)
2.(410256)
4.2(142857)
1.(148)
4.(6237)
0.2(412935323383084577114427860696517)
0.64(43089)
0.59375
1.075
0.(648526077097505668934240362811791383219954)
1.(931216)
3.(731092436974789915966386554621848739495798319327)
1.(921397379912663755458515283842794759825327510917030567685589519650655021834061135371179039301310043668122270742358078602620087336244541484716157205240174672489082969432314410480349344978165938864628820960698689956331877729257641)
0.(264957)
0.(35793)
2.74(857142)
0.(489461358313817330210772833723653395784543325526932084309133)
0.18(82022471910112359550561797752808988764044943)
1.(40793201133144475920679886685552)
0.1(849462365591397)
1.(672131147540983606557377049180327868852459016393442622950819)
1.76(612903225806451)
0.(0754716981132)
0.(705167173252279635258358662613981762917933130699088145896656534954407294832826747720364741641337386018237082066869300911854103343465045592)
0.(157894736842105263)
0.733(6956521739130434782608)
0.9(674418604651162790697)
2.(2818791946308724832214765100671140939597315436241610738255033557046979865771812080536912751677852348993288590604026845637583892617449664429530201342)
1.(327354260089686098654708520179372197309417040358744394618834080717488789237668161434977578475336322869955156950672645739910313901345291479820627802690582959641255605381165919282511210762331838565022421524663677130044843049)
0.4(816326530612244897959183673469387755102040)
0.(7671840354)
7.6(54)
0.776(639344262295081967213114754098360655737704918032786885245901)
1.(157894736842105263)
0.97(428571)
0.12(87)
0.(2995169082125603864734)
1.36(79775280898876404494382022471910112359550561)
0.(4949083503054989816700610997963340122199592668024439918533604887983706720977596741344195519348268839103869653767820773930753564154786150712830957230142566191446028513238289205702647657841140529531568228105906313645621181262729124236252545824847250509164969450101832993890020366598778004073319755600814663951120162932790224032586558044806517311608961303462321792260692464358452138492871690427698574338085539714867617107942973523421588594704684317718940936863543788187372708757637474541751527)
0.6(21917808)
0.82(339449541284403669724770642201834862385321100917431192660550458715596330275229357798165137614678899082568807)
8.(4705882352941176)
1.91(6)
0.(675)
3.(9173553719008264462809)
0.9(0632911392405)
0.(1223628691983)
0.(80204778156996587030716723549488054607508532423208191126279863481228668941979522184300341296928327645051194539249146757679180887372013651877133105)
0.7(42990654205607476635514018691588785046728971962616822)
13
14.(7586206896551724137931034482)
0.(6831)

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1shinh1001.81132008/09/06 03:07:010B / 28B / 65B
2niha1071.29682008/09/06 02:53:320B / 33B / 70B
3leonid1110.18222010/11/26 09:27:090B / 50B / 58B
4yowa1620.45252008/09/06 23:35:400B / 59B / 93B
5tabasa4020.50942008/09/06 12:46:4829B / ?B / ?B

Ruby2 _

RankUserSizeTimeDateStatistics
1mitchs930.20222015/10/27 17:44:430B / 42B / 49B

Perl _

RankUserSizeTimeDateStatistics
1tails650.48302021/05/20 18:44:220B / 27B / 34B
2teebee671.21512011/04/15 03:15:170B / 29B / 34B
3mitchs690.42982014/06/11 07:24:470B / 29B / 38B
4ySas882.34542008/09/08 00:57:440B / 26B / 58B
5Mithran1081.78862008/09/10 00:00:580B / 49B / 55B

Python _

RankUserSizeTimeDateStatistics
1hallvabo (alt)1570.52212023/01/29 22:34:260B / ?B / ?B
2xsot1580.08972016/08/09 21:10:570B / 78B / 73B
3recursive1660.07382011/01/27 01:48:070B / 74B / 82B
4hallvabo1670.15802010/11/25 16:23:500B / 82B / 72B
5lifthrasiir1700.16682011/05/18 15:19:300B / 83B / 76B
6twobit1720.10992011/01/27 03:38:080B / 80B / 77B
7rolf1790.07502013/02/16 10:54:160B / 82B / 85B

JavaScript _

RankUserSizeTimeDateStatistics
1nn1210.03612010/03/18 10:33:090B / 57B / 64B
2murky-satyr1210.07092010/08/23 01:48:490B / 56B / 65B
3xulapp1311.29902010/08/23 01:39:570B / 59B / 72B
4ktt1370.06382010/03/18 11:39:430B / 62B / 75B

Lua _

RankUserSizeTimeDateStatistics
1twobit2180.04372012/06/28 00:54:230B / 113B / 84B

C _

RankUserSizeTimeDateStatistics
1tails1840.02772021/05/20 20:23:450B / 83B / 101B
251b1960.03812008/09/11 03:33:030B / 94B / 102B

D _

RankUserSizeTimeDateStatistics
151b2030.07182008/10/27 00:16:040B / 99B / 101B

OCaml _

RankUserSizeTimeDateStatistics
1ksk2510.37952009/10/11 19:22:250B / 137B / 103B
2xsd2690.14172009/10/10 15:20:450B / 147B / 98B

Pascal _

RankUserSizeTimeDateStatistics
1uru2870.06832009/07/15 00:03:170B / 175B / 98B

AWK _

RankUserSizeTimeDateStatistics
1llhuii1200.04622014/03/18 22:36:500B / 46B / 74B
2nn1230.25722008/10/03 00:32:450B / 49B / 69B

bc _

RankUserSizeTimeDateStatistics
1McBusLuck59420.02242020/04/27 07:44:410B / 5404B / 392B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii1200.05102014/03/19 00:05:340B / 46B / 74B

Postscript _

RankUserSizeTimeDateStatistics
1yshl(bin)1630.87592008/09/12 03:53:0068B / 56B / 38B
2ySas1641.31792008/09/11 00:13:2469B / 45B / 50B
3yshl2970.83932008/09/11 21:29:460B / 211B / 37B

goruby _

RankUserSizeTimeDateStatistics
1murky-satyr940.30122009/12/27 07:56:110B / 32B / 58B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr964.33212009/12/27 07:36:440B / 50B / 45B
2nn1512.76962010/02/10 14:40:410B / 74B / 70B

Language Ranking_

RankLangUserSizeScore
1Perltails6510000
2Ruby2mitchs936989
3gorubymurky-satyr946914
4Groovymurky-satyr966770
5Rubyshinh1006500
6AWKllhuii1205416
7xgawkllhuii1205416
8JavaScriptnn1215371
9Pythonhallvabo (alt)1574140
10Postscriptyshl(bin)1633987
11Ctails1843532
12D51b2033201
13Luatwobit2182981
14OCamlksk2512589
15Pascaluru2872264
16bcMcBusLuck5942109

return to the top page