Templates for Google Code Jam contests in different programming languages.
In order to make a good demonstration of language constructs the following simple problem is solved by the templates.
Answer median and arithmetic mean calculation queries for given arrays of real numbers. For median queries arrays will have odd length. For each query answer must have 10 correctly rounded fractional digits.
Example of input:
2 median 3 2.32 1.55 3.17 mean 2 5 7
Example of output:
Case #1: 2.3200000000 Case #2: 6.0000000000
-- Feel free to contribute additional languages and corrections.
Todo: add multi-threaded templates.