#CCBCHBAHAI0000090. Tích vô hướng hai vector
Tích vô hướng hai vector
Dot Product of Two Vectors
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given two integer vectors
$$A=(a_0,\ldots,a_{n-1}),\qquad B=(b_0,\ldots,b_{n-1}),$$compute their dot product
Use a 64-bit accumulator.
Input
The first line contains . The second line contains and the third line contains .
Output
Print the dot product .
Subtask
Subtask 1 (20 points): , .
Subtask 2 (30 points): , .
Subtask 3 (50 points): , .
Example
Input
4
1 3 -2 5
4 -1 6 2
Output
-1
Explanation
The result follows directly from the mathematical definition above.