#B4252. Dot Product of Two Vectors

    ID: 11909 Type: Default 1000ms 256MiB

Dot Product of Two Vectors

Dot Product of Two Vectors

Given two vectors of length nn, compute their dot product. For vectors a=(a1,a2,,an)\mathbf{a}=(a_1, a_2, \cdots, a_n) and b=(b1,b2,,bn)\mathbf{b}=(b_1, b_2, \cdots, b_n), the dot product is defined as $$a_1b_1 + a_2b_2 + \cdots + a_nb_n.$$

Calculate the sum of the products of corresponding elements of the two vectors.

inputFormat

The first line contains an integer nn denoting the length of the vectors.
The second line contains nn integers representing the vector a\mathbf{a}.
The third line contains nn integers representing the vector b\mathbf{b}.

outputFormat

Output a single integer — the dot product of the given two vectors.

sample

3
1 2 3
4 5 6
32