#C2765. Calculate the Magnitude of a Vector

    ID: 46117 Type: Default 1000ms 256MiB

Calculate the Magnitude of a Vector

Calculate the Magnitude of a Vector

You are given a vector with n components. Your task is to calculate its magnitude using the formula:

$$||\vec{v}|| = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}$$

The input consists of an integer n followed by n space-separated real numbers representing the components of the vector. Compute and output the magnitude of the vector.

This problem tests your ability to perform basic arithmetic operations and implement mathematical formulas in code.

inputFormat

The input is provided via standard input and consists of two lines:

  • The first line contains a single integer n, representing the number of vector components.
  • The second line contains n space-separated real numbers.

outputFormat

Output the magnitude of the vector as a floating-point number to standard output.

## sample
2
3 4
5.0

</p>