#include using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (n); i++) #define repf(i, j, n) for (int i = (j); i < (n); i++) #define repr(i, n) for (int i = (n)-1; i >= 0; i--) signed main() { int l, r, n; cin >> l >> r >> n; if (n == 1) cout << r - l + 1 << endl, exit(0); int l1, l2, r1, r2; l1 = (l - 1) / n, l2 = l % n, r1 = (r - 1) / n + 1, r2 = r % n; vector a(n); rep(i, n) { int j = i == 0 ? n : i; a[i] = r1 - l1 - (j > r2) + (j < l2); } cout << r / n - l / n + (l % n == 0)<