#include #include #define REP(i,n) for(int i=0,i##_len=(n);i gutyoku(ll N,ll Q,vector> A,vector X){ vector res; REP(q,Q){ ll tmp=0; REP(i,N) tmp+=abs(A[i].first-X[q])*A[i].second; res.push_back(tmp); } return res; } int main(){ ll N,Q;cin>>N>>Q; vector> A(N); REP(i,N) cin>>A[i].first>>A[i].second; vector X(Q); REP(i,Q) cin>>X[i]; vector ans=gutyoku(N,Q,A,X); REP(i,Q){ cout<