/* GCC */
#include <fstream>

using namespace std;

int main(void)
{
    unsigned long n = 0, m = 0;
    ifstream in("pelmeni.in");
    in >> n >> m;
    unsigned long long* a = new unsigned long long[n];
    for(size_t i = 0; i < n; i++)
               in >> a[i];
    unsigned long long x = 0, sum = 0;
    unsigned long index = 0;
    ofstream out("pelmeni.out");
    for(size_t i = 0; i < m; i++)
    {
               in >> x;
               for(size_t j = index; j < n; j++)
               {
                          if(a[j] > x)
                                  break;
                          index++;
                          sum += a[j];
               } 
               out << sum + x*(n-index) << ' ';
    }
    out << endl;
    in.close();
    out.close();
    delete[] a;
    return 0;
}
