#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int price, diff, max, cash, cost=0 , result=-1; cin>>price>>diff>>max>>cash; while(cost <= cash){ result++; cost= cost+price; if(price-diff > max){ price = price-diff; } else price = max; } cout<