fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);
  7. int a, b, k;
  8. cin >> a >> b >> k;
  9. int c = 0;
  10. if(a != 0 && b - a >= k){c++;}
  11. cout << ((b - a) / k) + 1 - c;
  12. return 0;
  13. }
Success #stdin #stdout 0s 5324KB
stdin
2 11 10
stdout
1