#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define _USE_MATH_DEFINES #include using namespace std; //template #define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12; templateinline bool chmax(T& a,T b){if(ainline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} //end templateinline T get(){ char c='$'; while(c!='-' and !isdigit(c))c=getchar(); bool neg=(c=='-'); T res=neg?0:c-'0'; while(isdigit(c=getchar()))res=res*10+(c-'0'); return neg?-res:res; } templateinline void put(T x,char c='\n'){ if(x==0)putchar('0'); else{ if(x<0){putchar('-'),x*=-1;} int d[20],i=0; while(x){d[i++]=x%10,x/=10;} while(i--)putchar('0'+d[i]); } putchar(c); } int a[100010],cnt[100010]={}; int main(){ int n=get(),q=get(); rep(i,0,n)a[i]=get(); rep(_,0,q)cnt[get()]++; rep(i,0,n){ ll res=0; for(int j=0,k=i;j(res); } return 0; }