fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. #define endl '\n'
  5. #define fast ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
  6. #define cap pair<int,int>
  7. #define fi first
  8. #define se second
  9. #define pb push_back
  10. #define FOR(i,l,r) for(int i=l;i<=r;i++)
  11. #define FOD(i,r,l) for(int i=r;i>=l;i--)
  12. #define fill(f,x) memset(f,x,sizeof(f))
  13. #define lcm(a,b) (a/__gcd(a,b)*b)
  14. #define TIME 1.0 * clock() / CLOCKS_PER_SEC
  15.  
  16. signed main()
  17. {
  18. freopen("CAU1.INP","r",stdin);
  19. freopen("CAU1.OUT","w",stdout);
  20. fast;
  21. int x1,x2,a;
  22. cin>>x1>>x2>>a;
  23. int cnt=0;
  24. while(x1<x2)
  25. {
  26. x1+=a;
  27. cnt+=1;
  28. }
  29. cout<<cnt;
  30. return 0;
  31. }
  32.  
  33.  
  34.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty