#include #include #include int main() { int d = 0; long int left = 0; long int center = 0; long int right = 0; char str[20]; long int count = 0; gets(str); d = atoi(str); gets(str); left = atoi(str); gets(str); center = atoi(str); gets(str); right = atoi(str); if(!((center < left && center < right) || (center > left && center > right))){ long int lc = left - center; long int rc = right - center; if(lc > 0){ long double l = double(abs(lc)) / d; long double r = double(abs(rc)) / d; if(l > r) count = ceil(l) + 1; else count = ceil(r) + 1; } else { long double l = double(abs(lc)) / d; long double r = double(abs(rc)) / d; if (l > r) count = ceil(r) + 1; else count = ceil(l) + 1; } } else if((left == 0 && center == 0) || (right == 0 && center == 0)) count = -1; printf("%ld",count); return 0; }