#ifndef ONLINE_JUDGE//なんか手元ではデバックモードになって、atcoder上ではデバックモードにならないらしい ABC325Dはこれで通った #define _GLIBCXX_DEBUG//[]で配列外参照をするとエラーにしてくれる。上下のやつがないとTLEになるので注意 ABC311Eのサンプル4のデバックTLEなどに注意 #endif//これと上のONLINE JUDGEが絶対必要 //★TLEにならないはずなのにTLEになったらオンラインジャッジを消してデバックモードのまま提出をする。 #include using namespace std; using ll=long long; using ull=unsigned long long; using ld = long double; using Pii=pair; using Pll=pair; using TT=tuple; #define mPP(a,b) make_pair(a,b) #define mTT(a,b,c) make_tuple(a,b,c) #define rep1(a) for(int i = 0; i < (int)(a); i++) #define rep2(i, a) for(int i = 0; i < (int)(a); i++) #define rep3(i, a, b) for(int i = (int)(a); i < (int)(b); i++) #define rep4(i, a, b, c) for(int i = (int)(a); i < (int)(b); i += c) #define overload4(a, b, c, d, e, ...) e #define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define rrep(i,n) for(int i = (int)(n)-1; i >= 0; --i) #define RREP(i,advanced,n) for(int i = (int)(n)-1; i >= advanced; --i) #define all(vec) vec.begin(),vec.end() #define rall(vec) vec.rbegin(),vec.rend() #define ALL(a,middle,last) a.begin()+middle,a.begin()+last #define w_np(a) while(next_permutation(all(a))) #define chmax(x,y) x = max(x,y) #define chmin(x,y) x = min(x,y) #define mycin(vec) for(auto &v:vec) cin >> v; #define mycout(vec) for(auto &v:vec) cout << v << " "; #define dame cout<<-1< bcda のように一つ要素をずらす #define DISPLACE(vec,First,Middle,Last) rotate(vec.begin()+First,vec.begin()+Middle,vec.begin()+Last) // ……a[F-1] (( a[F] a[F+1] …… a[M-1] a[M] a[M+1] …… a[L-1] )) a[L]…… -> ……a[F-1] (( a[M] a[M+1] …… a[L-1] …… a[F] a[F+1] …… a[M-1] )) a[L]…… template using vc = vector; template using PQ = priority_queue>; // 大きい順に取り出す template using PQ_G = priority_queue, greater>; // 小さい順に取り出す ll pow2(ll x) { return x * x; }; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } vc di = { 1,-1,0,0 }; vc dj = { 0,0,1,-1 }; // vc di={1,1,0,-1,-1,-1,0,1}; // vc dj={0,1,1,1,0,-1,-1,-1}; int INF = 2e9; // ll INF = 2e18; int main() { ll n,t,x,y; cin >> n >> t >> x >> y; vc d(n); mycin(d); sort(all(d)); PQ Q; ll before = d[0], cnt = 1; rep(i,1,n) { if(d[i] - before <= t) cnt++; else { Q.push(cnt); cnt = 1; } before = d[i]; } Q.push(cnt); ll ans = 0; while(!Q.empty()) { ll SIZE = Q.top(); Q.pop(); rep(SIZE) cout << ans << " "; ans += x; } cout << endl; }