candies

Format

Input

读入格式如下:
n c
l1 l2 ... ln
r1 r2 ... rn

Output


Sample 1

Input

2 3
1 1
1 1

Output

4

Sample 2

Input

1 2
1
3

Output

14

Limitation

4s, 256MiB for each test case.