#include #include #include #include #include using namespace std; int main() { long int d, h1, h2, h3; long int cnt; cin >> d >> h1 >> h2 >> h3; if (h2 >= h1&&h2 <= h3 || h2<=h1&&h2>=h1){ if (h2 < d){ cout << -1 << endl; return 0; } if (h3 - h2 >= h2 - h1){ cnt = floor((h2 - h1) / d) +1; } else if (h3 - h2 < h2 - h1){ cnt = floor((h3 - h2) / d) +1; } } else{ cnt = 0; } cout << cnt << endl; return 0; }