#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <vector>#include <cmath>#include <map>#include <set>#include <queue>#include <algorithm>using namespace std;typedef long long LL;const int N=1000+5;LL n,wood,cost,gold;LL f[N],g[N],ans;LL x[N],y[N];int main(){while (cin>>n>>cost>>wood>>gold){x[0]=y[0]=0;for (int i=1;i<=n;i++)scanf("%lld%lld",x+i,y+i),x[i]=max(x[i],x[i-1]);f[n+1]=0;for (int i=n;i>=0;i--)f[i]=max(f[i+1]-y[i],x[i]);bool ok=true;g[0]=0;for (int i=0;i<=n;i++){gold+=y[i];g[i]=gold-f[i+1];if (g[i]<0)ok=false;}if (!ok){printf("It's useless to collect wood.n");continue;}ans=0;for (int i=1;i<=n;i++){LL tmp=g[i-1]/cost;if (tmp<wood){ans+=tmp*wood;}else {tmp+=wood;ans+=(tmp>>1)*(tmp-(tmp>>1));}}cout<<ans<<endl;}}


