#BS0000009. Sơn phòng (Room Painting)

Sơn phòng (Room Painting)

Room Painting

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

A paint shop offers nn fixed can sizes and has an unlimited number of cans of each size. You need mm different colours. For each required amount rjr_j, you buy exactly one can, and it must be large enough.

For every colour, choose the smallest offered can size cc with c≥rjc\ge r_j. The wasted paint is c−rjc-r_j.

Let cjc_j be the chosen can size for colour jj. The required total waste is:

∑j=1m(cj−rj).\sum_{j=1}^{m}(c_j-r_j).

Input

The first line contains nn and mm.

The next nn lines contain the offered can sizes in microlitres.

The next mm lines contain the required amounts in microlitres.

For every requirement, at least one offered can is large enough.

Output

Print the total number of wasted microlitres.

Subtasks

  • Subtask 1 — 20%: 1≤n,m≤1001\le n,m\le100.
  • Subtask 2 — 30%: 1≤n,m≤50001\le n,m\le5000.
  • Subtask 3 — 50%: 1≤n,m≤1051\le n,m\le10^5; every can holds at most 10001000 litres, i.e. at most 10910^9 microlitres.

Examples

Input

3 2
5
7
9
6
8

Output

2

Explanation

Requirement 66 uses can 77 and wastes 11. Requirement 88 uses can 99 and wastes 11, for a total of 22.