401362: GYM100418 B Sum of sequences

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Sum of sequencestime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

You finished RIUSB ACBJSO university few years ago and started working hard and growing your carrier. At the some moment you tried to pass an interview at the XEDNAY company. You successfully answered all tricky questions about advanced algorithms and data structures and got the last one. Given two sequences A, B you need to find the following sum:

Input

Input contains three lines. First contains two numbers lengths of sequences |A|, |B|. Second and third line contains |A| and |B| numbers separated by spaces (1 ≤ |A|, |B| ≤ 105, 1 ≤ Ai, Bi ≤ 104).

Output

Single line containing answer to the task.

ExamplesInput
5 4
3 4 5 4 4
1 2 3 4
Output
42

加入题单

上一题 下一题 算法标签: