~/algor $ cat problems/massiv-skalyar-kopaytma
Dot product
Easy
1000 ms
64 MB
22%
Two arrays of the same length are given: $a_{1}, \dots, a_{n}$ and $b_{1}, \dots, b_{n}$. Find their dot product — $a_{1} b_{1} + a_{2} b_{2} + \dots + a_{n} b_{n}$.
Input
The first line contains a positive integer $n$.
The second line contains $n$ integers — the array $a$.
The third line contains $n$ integers — the array $b$.
Output
One integer — the dot product.
Note
$1 \le n \le 1000$
the elements are from $-10^{6}$ to $10^{6}$
Examples
Input #1
3 1 2 3 4 -5 6
Output #1
12
Input #2
1 -7 8
Output #2
-56