#include <iostream>
#include <vector>

using namespace std;

#define int long long

void read(vector<int>& a) {
    for (int& i : a) {
        cin >> i;
    }
}
signed main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n), d(m), c(m);
    read(a);
    read(d);
    read(c);
    for (int i = 0; i < n; ++i) {
        int sum = 0;
        for (int j = 0; j < m; ++j) {
            if (a[i] > d[j]) {
                sum += c[j];
            }
        }
        cout << sum << endl;
    }
    return 0;
}

