#Z15107. 向量点积计算

向量点积计算

Description

In linear algebra and computational geometry, the dot product of vectors is a highly important operation. Given two nn-dimensional vectors a=(a1,a2,...,an)a=(a_1,a_2,...,a_n) and b=(b1,b2,...,bn)b=(b_1,b_2,...,b_n), compute the dot product ab=a1b1+a2b2+...+anbna·b=a_1b_1+a_2b_2+...+a_nb_n.

Input Format

The first line contains an integer n(1n1000)n(1≤n≤1000);
The second line contains nn integers a1,a2,...,ana_1,a_2,...,a_n;
The third line contains nn integers b1,b2,...,bnb_1,b_2,...,b_n;
Adjacent integers are separated by a single space. The absolute value of each integer does not exceed 10001000.

Output Format

A single integer representing the result of the dot product of the two vectors.

3
1 4 6
2 1 5

36