#include using namespace std; typedef unsigned long long ull; typedef long long ll; #define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define test() ull t;cin>>t;while(t--) #define pb push_back #define mkp make_pair #define nl cout<>p>>d>>m>>s; int cnt=0,sum=0,cur=p; while(1) { if(s>=cur) { s-=cur; cnt++; cur-=d; if(cur<=m) cur=m; } else break; } cout<