#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x > > M; void solve() { int i,j,k,l,r,x,y; string s; cin>>N>>D>>T; FOR(i,N) { cin>>X[i]; M[(D+X[i]%D)%D].push_back(make_pair(X[i]-D*T,X[i]+D*T)); } ll ret=0; ITR(it,M) { vector > V=it->second; ll mi=-1LL<<60,ma=-(1LL<<60)-D; sort(V.begin(),V.end()); FOR(i,V.size()) { if(V[i].first>ma) { ret+=(ma-mi)/D+1; mi=V[i].first; } ma=V[i].second; } ret+=(ma-mi)/D+1; } cout<