#include using namespace std; #define ALL(x) begin(x),end(x) #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const vector&v){ for(int i=0;i<(int)v.size();i++) os< istream &operator>>(istream &is,vector&v){ for(T &x:v)is>>x; return is; } signed main(){ int n;ll k;cin>>n>>k; vector p(n); cin>>p; int LOG=34; vector> v(n,vector(LOG,0)),w(n,vector(LOG,0)); rep(i,n){ if(i+p[i]>=n) v[i][0]=1; else v[i][0]=0; w[i][0]=(i+p[i])%n; } rep(j,LOG-1){ rep(i,n){ v[i][j+1]=v[i][j]+v[w[i][j]][j]; w[i][j+1]=(w[w[i][j]][j]); } } rep(i,n){ int pos=i; ll time=0; rep(j,LOG)if((k>>j)&1){ time+=v[pos][j]; pos=w[pos][j]; } cout<