#include //#include // Common file //#include // Including seg_tree_order_statistics_node_update #include #include using namespace std; //using namespace __gnu_pbds; typedef long long lo; typedef pair ll;//pair typedef vector vl; //vector of long typedef vector vll; //vector of pair typedef priority_queuep_q; typedef vector< vl > vvl; //vector of vectors #define X first #define Y second #define mp(a,b) make_pair((a),(b)) #define REP(a,b) for(lo i=(a);i<(lo)b;i++)//no need to declare variable i #define REPE(a,b,c,d) REP(a,b)for(lo j=(c);j<(lo)d;j++)//no need to declare vaiables i,j #define REPV(a,b,c) for((a)=b;(a)<(c);(a)++)//a is the variable #define IREP(a,b) for(lo i=(a);i>=(b);i--) #define IREPV(a,b,c) for((a)=b;(a)>=(c);(a)--) #define all(v) (v).begin(),(v).end() #define TRV(a) for(auto it : a) #define INF 200100 #define MOD 1000000007 #define M 1000000007 #define CHECK_BIT(var,pos) ((var) & (1<<(pos))) #define pb(a) push_back((a)) /*order statistic tree typedef tree< lo, null_type, less_equal, rb_tree_tag, // This policy updates nodes' metadata for order statistics. tree_order_statistics_node_update> ordered_set;*/ /*#define gc getchar_unlocked #define pc putchar_unlocked inline void sprlo( lo a){ lo i=0; char S[20]; if(a==0)pc('0'); if(a<0){ pc('-'); a*=-1; } while(a>0){ S[i++]=a%10+'0'; a=a/10; } --i; while(i>=0) pc(S[i--]); pc(' '); } inline void lprlo( lo a){ lo i=0; char S[20]; if(a==0)pc('0'); while(a>0){ S[i++]=a%10+'0'; a=a/10; } --i; while(i>=0) pc(S[i--]); pc('\n'); } inline lo uscan(){ lo n=0; char c=gc(); while(c<'0'||c>'9')c=gc(); while(c<='9'&&c>='0'){ n=n*10+c-'0'; c=gc(); } return n; }*/ template ostream& operator<< ( ostream &o,vector v ) { if ( v.size() >0 )o< ostream& operator<< ( ostream &o,pair p ) { return o<<"("< istream& operator>> ( istream &in,vector &v ) { for ( unsigned i=0; i>v[i]; return in; } template istream& operator>> ( istream &in,pair &p ) { in>>p.X; in>>p.Y; return in; } lo dig(lo n){ lo x=0; while(n>0){ n/=10; x++; } return x; } int main(){ std::ios::sync_with_stdio(false); lo p,d,m,s; cin>>p>>d>>m>>s; lo ans=0; lo sum=0; while(sum<=s){ sum+=p; //cout<m)p-=d; if(p