Lazy Verma

3

4 votes
cake-walk, adhoc
Problem

Verma has got 2 arrays of integer numbers. He wished to find the sum of product of all numbers in first array with all the numbers in second array.

i.e suppose 1st array A[] contains N numbers and 2nd array B[] contains m numbers. He wished to calculate for all 1 <= i <= N and for all 1 <= j <= M.. sum(Ai*Bi).

As he is busy watching NARUTO. He seeks your help in finding this.

Input Format

1st line contains 2 space separated integers N and M.
2nd line contains N space separated integers Ai.
3rd line contains M space separated integers Bi.

Output Format

1 single line containing only the required answer.

Constraints

1 <= N,M <= 105
-1000 <= Ai, Bi <= 1000

Problem Setter : Sanchit Bhushan
Problem Tester : Pranjul Dubey

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Here answer is 31 + 32 + 41 + 42

Editor Image

?