Standard Deviation

In mathematics, the standard deviation of a set of n integer numbers is defined as: √ 1 ∑n x ̄= · xi Σni=1(xi − x ̄)2 n−1 S= where x ̄ is the average of the set of n integer numbers for which the standard deviation is being calculated. That average is calculated as: n i=1 The task is to calculate, in an efficient way, the standard deviation of the first n odd positive integer numbers. Input There are several test cases in the input. Each test case consists of a single line containing a positive integer number n (2 ≤ n ≤ 106) which indicates the amount of consecutive odd numbers (starting from one) that should be considered when calculating the standard deviation. The last test case has a value of ‘0’, for which you shouldn’t generate any response. Output For each test case, you should print a single line containing a floating point number: the standard deviation of the first n odd positive numbers. The absolute error of your answer should not be greater than 10−6. Sample Input 10 100 1000 10000 100000 1000000 0 Sample Output 6.055301 58.022984 577.638872 5773.791360 57735.315593 577350.557865