#C12368. Sum of Squares
Sum of Squares
Sum of Squares
Given a list of integers, compute the sum of the squares of its elements. Mathematically, you are to compute the value
\( S = \sum_{i=1}^{n} a_i^2 \)
where \(a_i\) represents the i-th integer in the list. Your program should read input from stdin
and write the result to stdout
.
inputFormat
The first line contains a single integer n
representing the number of integers.
The second line contains n
space-separated integers.
outputFormat
Output a single integer which is the sum of squares of the given integers.
## sample4
1 2 3 4
30