#pragma region template #pragma GCC optimize("Ofast") #include using namespace std; #ifdef __LOCAL #include #else #define debug(...) void(0) #endif #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() template istream& operator>>(istream&is,vector&v){ for(T&p:v)is>>p; return is; } template ostream& operator<<(ostream&os,const vector&v){ if(&os==&cerr)os<<"["; for(int i=0;i>n>>d>>t; map> mp; REP(_,n){ ll x;cin>>x;x+=INF; mp[x%d].push_back(x/d); } ll ans=0; for(auto&[id,ve]:mp){ sort(ALL(ve)); ll pre=-INF; for(ll p:ve){ ans+=p+t-max(pre+1,p-t)+1; pre=p+t; } } cout<