#include <bits/stdc++.h>   using namespace std;   int main() {     int n, d, res = 0, a = 0, b;     cin >> n >> d;     for (int i = 0; i < n; i++) {       cin >> b;       if (a >= b) {         res += ceil((a - b + 1) / (double)d);         b += ceil((a - b + 1) / (double)d) * d;       }       a = b;     }     cout << res << endl;   }   