Gottfried Sequence
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
Find the value of following sequence upto n terms
1 - 1/3 + 1/5 - 1/7 + 1/9 - ....
Input format:
T ( no of test cases )
n1
n2
n3
.
.
nT
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
10
84
87
78
16
94
36
87
93
50
22
Sample output:
0.782422078351511
0.78827163171926
0.782193166868439
0.769788348549357
0.782738664166981
0.778455057255894
0.78827163171926
0.788086257749869
0.780398663147753
0.774040381615911
Sample input:_
100
89384
30887
92778
36916
47794
38336
85387
60493
16650
41422
2363
90028
68691
20060
97764
13927
80541
83427
89173
55737
5212
95369
2568
56430
65783
21531
22863
65124
74068
3136
13930
79803
34023
23059
33070
98168
61394
18457
75012
78043
76230
77374
84422
44920
13785
98538
75199
94325
98316
64371
66414
3527
76092
68981
59957
41874
6863
99171
6997
97282
2306
20926
77085
36328
60337
26506
50847
21730
61314
25858
16125
53896
19583
546
98815
33368
15435
90365
44044
13751
71088
26809
17277
47179
95789
93585
5404
2652
92755
12400
99933
95061
49677
93369
47740
10013
36227
98587
48095
97540
Sample output:
0.785395366476284
0.785406257417584
0.785395468793108
0.785391391266125
0.785392932615342
0.785391642111975
0.785401091243592
0.785402296107011
0.785383148382448
0.785392127957344
0.785503961107481
0.785395386483585
0.78540180288442
0.785385700785293
0.785395606218918
0.785416114140583
0.785401267406576
0.78540116002922
0.785400966936622
0.785402648748288
0.785350197166117
0.785400784794321
0.785300811376217
0.785393733129857
0.785401963771396
0.785409774562738
0.785409098095426
0.785394324566902
0.785394788120665
0.78531844401172
0.785380216520226
0.785401296111746
0.785405511367938
0.785409005151204
0.785390603675649
0.785395616742716
0.785394091338283
0.785411708393916
0.785394830597353
0.785401366759685
0.785394883848703
0.785394932337907
0.785395202084031
0.78539259794776
0.785416299052119
0.785395626305141
0.785401487909733
0.785400813808245
0.785395620576323
0.785402047133906
0.78539439913087
0.785469045165234
0.785394877900933
0.785401787583812
0.785402333052361
0.785392193105619
0.785434590615671
0.785400684295677
0.785433892995663
0.785395593548947
0.785289750566465
0.78538621653709
0.785401406570556
0.785391281653341
0.785402306792042
0.785388731570694
0.785403080108362
0.785386658565424
0.785394086025227
0.785388495209655
0.785413667273402
0.785393524834287
0.785410929572184
0.784940288323546
0.785400693377697
0.785390671189347
0.785414360352402
0.785400929955282
0.785392487255409
0.785416343893386
0.785394646629493
0.785407488624046
0.7854126335022
0.785403462365209
0.785400773300446
0.785400834765707
0.785351901369717
0.785303894924178
0.785400858669924
0.785378002107155
0.785400665073552
0.785400793287712
0.78540319590746
0.785400840945655
0.785392926698663
0.785423130939579
0.785405064327693
0.785400699228727
0.785403361442981
0.785395600346373
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | teebee | 56 | 0.8880 | 2013/02/09 09:30:51 | 0B / 21B / 35B |
2 | brx | 60 | 1.3051 | 2013/02/19 21:33:11 | 0B / 23B / 35B |
3 | primo | 61 | 1.5090 | 2013/02/08 17:21:47 | 0B / 25B / 36B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 83 | 0.4171 | 2013/02/08 08:14:13 | 0B / 45B / 34B |
2 | clock | 83 | 0.9200 | 2013/02/08 08:58:08 | 0B / 45B / 33B |
3 | primo | 83 | 0.4150 | 2013/02/08 18:23:05 | 0B / 45B / 34B |
4 | hallvabo | 98 | 0.4492 | 2013/02/06 19:21:13 | 0B / 53B / 41B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 147 | 1.8452 | 2013/03/02 08:33:25 | 0B / 99B / 40B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | clock(pooq) | 109 | 0.0992 | 2013/03/01 19:18:00 | 0B / 60B / 43B |
2 | pooq | 111 | 0.1073 | 2013/03/01 18:08:27 | 0B / 61B / 42B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 108 | 0.2258 | 2013/03/01 10:25:47 | 0B / 66B / 30B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Perl | teebee | 56 | 10000 |
2 | Ruby | leonid | 68 | 8235 |
3 | Python | leonid | 83 | 6746 |
4 | BASIC | pooq | 108 | 5185 |
5 | Lua | clock(pooq) | 109 | 5137 |
6 | Io | pooq | 147 | 3809 |
return to the top page