Super Fast Fourier Transform
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo has two sequences of integers and .
He would like to find


Note that denotes the maximum integer does not exceed x,
and |x| denotes the absolute value of x.

输入描述:

The input contains at most 30 sets. For each set:
The first line contains 2 integers n, m ().
The second line contains n integers .
The thrid line contains m integers .
()

输出描述:

For each set,
an integer denotes the sum.
示例1

输入

复制
1 2
1
2 3

输出

复制
2
示例2

输入

复制
2 3
1 2
3 4 5

输出

复制
7