There are two points $(p_1, p_2, \cdots, p_n)$ and $(q_1, q_2, \cdots, q_n)$ with integer coordinates on a $n$-dimensional coordinate plane. Compute their:
- Manhattan distance: $|p_1 - q_1| + |p_2 - q_2| + \cdots + |p_n - q_n|$
- Chebyshev distance: $\max(|p_1 - q_1|, |p_2 - q_2|, \cdots, |p_n - q_n|)$
- Euclidean distance: $\sqrt{(p_1 - q_1)^2 + (p_2 - q_2)^2 + \cdots + (p_n - q_n)^2}$
Input
The first line of input contains an integer $n$.
The second line of input contains $n$ integers, $p_1, p_2, \cdots, p_n$.
The third line of input contains $n$ integers, $q_1, q_2, \cdots, q_n$.
Output
Output the Manhattan, Chebyshev and Euclidean distance on separate lines.
The Manhattan and Chebyshev distances must be integers.
For the Euclidean distance, your output is considered correct if the difference
between your output and the actual answer is less than $10^{-4}$.
Constraints
$1 \le n \le 10^5$
$-10^5 \le p_i, q_i \le 10^5$
Sample Test Cases
Input | Output | |
---|---|---|
2 6 9 4 20 |
13 11 11.18033988 |
|
1 -5 5 |
10 10 10.0 |
Scoring: Per Subtask
Authored by s16f22