#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; const int inf=1<<30; const ll INF=1LL<<62; typedef pair P; typedef pair PP; const ll MOD=998244353; const int dy[]={0,1,0,-1}; const int dx[]={1,0,-1,0}; int main(){ int N,M; cin>>N>>M; vector A(N); for(int i=0;i>A[i]; } if(M==0){ for(int k=1;k<=N;k++){ cout< cnt_appear(M+1,0);// cnt_appear[i]=数iが登場した回数 vector cum_sum(N+5,0); int l=0,r=0; while(l ans(N+1,0); for(int i=1;i<=N;i++){ ans[i]=cum_sum[i]; cout<