Улитка

mail@pastecode.io avatar
unknown
c_cpp
a month ago
425 B
4
Indexable
Never
#include <iostream>

using namespace std;

int main() {
    int h, a, b;
    cin >> h >> a >> b;
    int v = a - b;
    int s = h - a;
    cout << (s + v - 1) / v + 1; 
    return 0;
}
/*
v = 3
s = 6
((6 + 0) + 3 - 1) / 3 = 2
    
v = 3
s = 7
((6 + 1) + 3 - 1) / 3 = 3

v = 3
s = 8
((6 + 2) + 3 - 1) / 3 = 3
    
v = 3
s = 9
((9 + 0) + 3 - 1) / 3 = 3

v = 3
s = 10
((9 + 1) + 3 - 1) / 3 = 4
*/