#ABC180B. [ABC180B] 各种距离

[ABC180B] 各种距离

提示:该题测试数据补录中,暂不支持评测提交。

No testdata at current.

No submission language available for this problem.

Score : 200200 points

Problem Statement

Given is a point (x1,…,xN)(x_1,\ldots,x_N) in an NN-dimensional space.

Find the Manhattan distance, Euclidian distance, and Chebyshev distance between this point and the origin. Here, each of them is defined as follows:

  • The Manhattan distance: ∣x1∣+…+∣xN∣|x_1|+\ldots+|x_N|
  • The Euclidian distance: ∣x1∣2+…+∣xN∣2\sqrt{|x_1|^2+\ldots+|x_N|^2}
  • The Chebyshev distance: max⁡(∣x1∣,…,∣xN∣)\max(|x_1|,\ldots,|x_N|)

Constraints

  • 1≤N≤1051 \leq N \leq 10^5
  • −105≤xi≤105-10^5 \leq x_i \leq 10^5
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN

x1x_1 …\ldots xNx_N

Output

Print the Manhattan distance, Euclidian distance, and Chebyshev distance between the given point and the origin, each in its own line. Each value in your print will be accepted when its absolute or relative error from the correct value is at most 10−910^{-9}.

2
2 -1
3
2.236067977499790
2

Each of the distances is computed as follows:

  • The Manhattan distance: ∣2∣+∣−1∣=3|2|+|-1|=3
  • The Euclidian distance: ∣2∣2+∣−1∣2=2.236067977499789696…\sqrt{|2|^2+|-1|^2}=2.236067977499789696\ldots
  • The Chebyshev distance: max⁡(∣2∣,∣−1∣)=2\max(|2|,|-1|)=2
10
3 -1 -4 1 -5 9 2 -6 5 -3
39
14.387494569938159
9