#include #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(a);i>=(b);i--) #define pb push_back using namespace std; typedef long long ll; typedef pair pii; typedef vector vi; typedef set si; const int inf = 1e9; ll n, d, t, x[100]; map m; main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> n >> d >> t; FOR(i, 0, n)cin >> x[i]; sort(x, x+n); ll ans = 0; FOR(i, 0, n){ ll y = x[i]; ll mod = (y%d + d)%d; if(m.find(mod) == m.end()){ ans += t * 2 + 1; }else{ ans += min(t * 2 + 1, (y - m[mod]) / d); } m[mod] = y; } cout << ans << endl; }