N, M = list(map(int, input().split()))

Xlist = sorted(list(map(int, input().split())))

sbn = [abs(Xlist[i] - Xlist[i + 1]) for i in range(M - 1)]

sbn.sort(reverse=True)

print((sum(sbn[N - 1:])))
N, M = list(map(int, input().split()))

Xlist = sorted(list(map(int, input().split())))[::-1]

sbn = sorted([abs(Xlist[i] - Xlist[i+1]) for i in range(M-1)])[::-1]

if N >= M:

    print((0))

else:

    print((sum(sbn[N-1:])))
N, M = list(map(int, input().split()))
Xlist = sorted(list(map(int, input().split())))
sbn = [abs(Xlist[i] - Xlist[i + 1]) for i in range(M - 1)]
sbn.sort(reverse=True)
print((sum(sbn[N - 1 :])))

N, M = list(map(int, input().split()))
Xlist = sorted(list(map(int, input().split())))[::-1]
sbn = sorted([abs(Xlist[i] - Xlist[i + 1]) for i in range(M - 1)])[::-1]
if N >= M:
    print((0))
else:
    print((sum(sbn[N - 1 :])))

-Xlist = sorted(list(map(int, input().split()))) -sbn = [abs(Xlist[i] - Xlist[i + 1]) for i in range(M - 1)] -sbn.sort(reverse=True) -print((sum(sbn[N - 1 :]))) +Xlist = sorted(list(map(int, input().split())))[::-1] +sbn = sorted([abs(Xlist[i] - Xlist[i + 1]) for i in range(M - 1)])[::-1] +if N >= M: +    print((0)) +else: +    print((sum(sbn[N - 1 :])))