#CCBCHBAHAI0000090. Tích vô hướng hai vector

    ID: 1008 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesWorking with numbersInteger arithmetic

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

A⋅B=∑i=0n−1aibi.\boxed{A\cdot B=\sum_{i=0}^{n-1}a_i b_i}.

Use a 64-bit accumulator.

Input

The first line contains nn. The second line contains AA and the third line contains BB.

Output

Print the dot product A⋅BA\cdot B.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le10, ∣ai∣,∣bi∣≤103|a_i|,|b_i|\le10^3.

Subtask 2 (30 points): 1≤n≤50001\le n\le5000, ∣ai∣,∣bi∣≤105|a_i|,|b_i|\le10^5.

Subtask 3 (50 points): 1≤n≤2⋅1051\le n\le2\cdot10^5, ∣ai∣,∣bi∣≤106|a_i|,|b_i|\le10^6.

Example

Input

4
1 3 -2 5
4 -1 6 2

Output

-1

Explanation

The result follows directly from the mathematical definition above.