Untitled

 avatar
unknown
plain_text
2 years ago
507 B
9
Indexable
#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;
}
Editor is loading...