#include<iostream>
#include<math.h>
#define N 100005
using namespace std;
long long n, ans = 1;
long double x, p, q, r, t[N], wrk, slp, tot, tmp, num;
int main(){
scanf("%lld%Lf%Lf%Lf", &n, &x, &p, &q);
r = p / q, tmp = wrk = x * (1.0 - r), slp = x - wrk;
for(int i = 1; i <= n; i++){
scanf("%Lf", &t[i]);
}
for(int i = 1; i <= n; i++){
if(wrk < t[i]){
tot = 0, num = (t[i] - wrk) / tmp, ans += ceil(num);
if(floor(num) * tmp < t[i] - wrk) wrk += ceil(num) * tmp;
else wrk = t[i];
}
tot += t[i], slp = x - tot;
if(slp <= 0) ans++, wrk += x - tot, tot = t[i], slp = x - tot;
else wrk -= t[i];
}
printf("%lld", ans);
return 0;
}
如果任务在这天睡觉前能做完就做,如果下一个任务今天做不完了就先睡,然后把多睡的时间加给第二天的工作时间,如果连续做的任务时间加起来比一天的时间还要多(即一天没睡觉),就把当前做的最后一个任务放到明天去做,然后明天的工作时间加上今天剩下睡觉的时间。