#K41337. Sum of Squares

    ID: 26843 Type: Default 1000ms 256MiB

Sum of Squares

Sum of Squares

Given a list of integers, compute the sum of the squares of the numbers. More formally, given a list \( a_1, a_2, \dots, a_n \), you are required to calculate the sum \( \sum_{i=1}^{n} a_i^2 \). The list may include negative numbers, and if the list is empty, the result should be 0.

inputFormat

The input consists of two lines. The first line contains an integer \( n \) which denotes the number of integers. The second line contains \( n \) space-separated integers.

outputFormat

Output a single integer — the sum of the squares of the input integers.

## sample
4
1 2 3 4
30