/* GCC */

#include <stdio.h>
#define maxN 100000

long long n, m, A[maxN], i, X, pX, value, aIndex;

int main()
{
    freopen("pelmeni.in", "r", stdin);
    freopen("pelmeni.out", "w", stdout);

    scanf("%I64d %I64d", &n, &m);
    for (i = 0; i < n; i++)
        scanf("%I64d", &A[i]);
    pX = 0;
    value = 0;
    aIndex = 0;
    for (i = 0; i < m; i++)
    {
        scanf("%I64d", &X);
        value += (X - pX) * (n - aIndex);
        while (aIndex < n && A[aIndex] < X)
        {
            value += A[aIndex] - X;
            aIndex++;
        }
        pX = X;
        printf(i < m - 1 ? "%I64d " : "%I64d\n", value);
    }

    return 0;
}
