#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); else count = ceil(r); } else { long double l = double(abs(lc)) / d; long double r = double(abs(rc)) / d; if (l > r) count = ceil(r); else count = ceil(l); } } printf("%ld",count); return 0; }