Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

BENCHI - Chi-square test of Benford distribution

I'm not a great tale-teller. Hence here are no stories about uncovered trickery but only the facts.
You get around 500 integers between 1 and 100000. Check with the Χ2 test how well the distribution of their first digits does observe Benford's law.

Input

In the first line one number N, then N lines with one number.

Output

The result of the Χ2 test of the Benford distribution with two digits after the decimal point.

Example

Input:
10
45564
2915
1454
14200
19
12943
4375
36588
31858
474
Output:
8.37

Added by:HWK
Date:2011-03-05
Time limit:3.200s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: SCM qobi

hide comments
2011-09-26 14:47:00 Hallvard Norheim Bø
@HWK: I think you need to update your C solution :)
2011-08-15 11:43:33 HWK
@Daniel Hui: Check the map. ;-)
2011-04-10 17:45:17 HWK
@Daniel Hui: Well done! But you give away two bytes.
2011-03-29 20:34:50 HWK
Congratulation!
With Python I can't beat it but with Perl (99). Perhaps you may try Bash and beat 106 bytes? ;-)
2011-03-29 19:14:13 Hallvard Norheim Bø
131 bytes now. Can you beat it? ;-)
2011-03-28 19:06:47 HWK
@hallvabo: My Python solution before publication requires 139 bytes. Thus you must shorten. ;-)
Perhaps interesting: http://www.spoj.pl/problems/FIBSUM/


Last edit: 2011-03-28 19:07:33
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.