#include <bits/stdc++.h>   using namespace std;   const long double pi = 4 * atan((long double)1);   const long long mod = 1e9 + 7;   const long long inf = 922337203685477;   const long long nax = 1e5 + 5;   long long n, p, m;   long long d[nax], t[nax];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> n >> p >> m;     for (long long i = 1; i <= n; i++) {       cin >> d[i] >> t[i];     }     d[0] = 1;     d[n + 1] = m + 1;     long long cur = 0, ans = 0;     for (long long i = 1; i <= n + 1; i++) {       long long dif = 0;       if (cur > 0) {         dif = cur / p;       }       long long minus = d[i] - d[i - 1] - dif;       if (minus < 0) {         minus = 0;       }       ans += minus;       cur -= (d[i] - d[i - 1]) * p;       cur += t[i];     }     cout << ans <<   n ;   }   