func_code_string: #include <bits/stdc++.h>   long long n, m, a, d, t[100007], old, ans, aind, firstA, stepD;   int main() {     std::ios::sync_with_stdio(0);     std::cin.tie(0);     std::cout.tie(0);     std::cin >> n >> m >> a >> d;     for (int i = 0; i < m; ++i) std::cin >> t[i];     aind = d / a * a + a;     for (int i = 0; i < m; ++i) {       if (t[i] <= old) continue;       if (t[i] <= n * a) {         firstA = (old / a + 1) * a;         if (t[i] <= firstA) {           ++ans;           old = t[i] + d;         } else {           stepD = (t[i] - firstA) / aind + ((t[i] - firstA) % aind ? 1 : 0);           ans += stepD;           old = firstA + stepD * aind - (a - d % a);           if (old < t[i]) {             ++ans;             firstA = (old / a + 1) * a;             old = std::min(t[i], firstA) + d;           }         }       } else {         if (old < n * a) {           firstA = (old / a + 1) * a;           stepD = (n * a - firstA) / aind + ((n * a - firstA) % aind ? 1 : 0);           ans += stepD;           old = firstA + stepD * aind - (a - d % a);           if (old < n * a) {             ++ans;             firstA = (old / a + 1) * a;             old = firstA + d;           }         }         if (old < t[i]) {           ++ans;           old = t[i] + d;         }       }     }     if (old < a * n) {       firstA = (old / a + 1) * a;       stepD = (a * n - firstA) / aind + ((a * n - firstA) % aind ? 1 : 0);       ans += stepD;       old = firstA + stepD * aind - (a - d % a);       if (old < a * n) {         ++ans;       }     }     std::cout << ans;   }   