#include using namespace std; #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") int N,Q,r,x,i,m,sum,cnt[100000]; vector B; short A[100000]; int main(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); cin>>N>>Q; for(i=0;i>A[i]; sum+=A[i]; } while(Q--){ cin>>r; cnt[r]++; } m=*min_element(cnt,cnt+N); B.resize(N,m*sum); for(i=0;i