/*Flow..................*/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i,a,n) for(i=a;i=n;i--) #define FORS(i,a) for(i=0;a[i];i++) #define si(x) scanf("%d",&x) #define sc(x) cin>>x #define sd(x) scanf("%lf",&x) #define sll(x) scanf("%lld",&x) #define ss(x) scanf("%s",x) #define prs(x) printf("%d ",x) #define pls(x) printf("%lld ",(long long)x) #define pc(x) printf("%c",(char)x) #define pi(x) printf("%d\n",x) #define pd(x) printf("%0.10lf\n",x); #define pll(x) printf("%lld\n",(long long)x) #define ps(x) printf("%s\n",x) #define M 1000000007 #define ll long long #define mp make_pair #define all(x) x.begin(),x.end() #define pb push_back #define fr first #define se second #define in insert #define er erase #define pii pair #define plll pair #define PI 3.14159265358979323846264338327950288419716939937510582097494459230 #define bs(x,y,z,w) {cerr< ostream& operator<<(ostream& os, const set &p){os << "{ "; for (T x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const multiset &p){os << "{ "; for (T x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const map &p){os << "{ "; for (pair x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const pair &p){os << "{" << p.first << ',' << p.second << "}";return os;} ll gcd (ll a, ll b) {return ( a ? gcd(b%a, a) : b );} ll power(ll a, ll n) {ll p = 1;while (n > 0) {if(n&1) {p = p * a;} n >>= 1; a *= a;} return p;} ll power(ll a, ll n, ll mod) {ll p = 1;while (n > 0) {if(n&1) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;} const int N=100005; ll a[N]; ll tr[4*N],la[4*N]; int n,k; ll mn[20][N],mx[20][N],orr[20][N],andd[20][N]; void pushdown(int si,int s,int e) { if(!la[si]) return; tr[si]=max(tr[si],la[si]); if(s!=e) { la[2*si+1]=max(la[2*si+1],la[si]); la[2*si+2]=max(la[2*si+2],la[si]); } } void update(int si,int s,int e,int l,int r,ll x) { pushdown(si,s,e); if(s>e || re || r=k) update(0,0,n,i,j,j-i+1); } FOR(i,1,n+1) pll(query(0,0,n,i,i)); return 0; }