#CCBCHBAHAI0000092. Sai lệch tuyệt đối trung bình

    ID: 1010 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesWorking with numbers

Sai lệch tuyệt đối trung bình

Mean Absolute Deviation

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given integer observations a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1}, let

μ=1n∑i=0n−1ai\mu=\frac1n\sum_{i=0}^{n-1}a_i

and define the mean absolute deviation

D=1n∑i=0n−1∣ai−μ∣.\boxed{D=\frac1n\sum_{i=0}^{n-1}|a_i-\mu|}.

Print DD with exactly 6 digits after the decimal point.

Input

The first line contains nn. The second line contains nn integers aia_i.

Output

Print DD with exactly 6 digits after the decimal point.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le10, ∣ai∣≤103|a_i|\le10^3.

Subtask 2 (30 points): 1≤n≤50001\le n\le5000, ∣ai∣≤106|a_i|\le10^6.

Subtask 3 (50 points): 1≤n≤2⋅1051\le n\le2\cdot10^5, ∣ai∣≤106|a_i|\le10^6.

Example

Input

4
1 2 7 10

Output

3.500000

Explanation

The result follows directly from the mathematical definition above.