Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
507 B
5
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
    unsigned int n;
    unsigned int a;
    unsigned int b;
    unsigned int c;
    unsigned int zp=0;
    int count = 0;
    cin >> n >> a >> b >> c;
    while(zp<n) {
        //Ночь
        count++;
        //Утро
        while (zp >= b) {
            if ((n-zp) / a >= b / c) {
                zp -= b;
                a += c;
            }
        }
        //Вечер
        zp += a;

    }
    cout << count;
}