fork download
  1. //By Zank100
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. #define ll long long
  5. #define mod 1000000007
  6. #define din(t) long long t;cin>>t;
  7. #define in(t) cin>>t;
  8. int main()
  9. {
  10. ios_base::sync_with_stdio(false); cin.tie(NULL);
  11. din(A);din(B);
  12. ll ans;
  13. if(B>A)
  14. {
  15. ll a=A-1;
  16. if(B%a<=1)
  17. {
  18. ans=B/a;
  19. }else{
  20. ans=B/a;
  21. ans++;
  22. }
  23. }else if(B==1){
  24. ans=0;
  25. }else{
  26. ans=1;
  27. }
  28. cout<<ans<<endl;
  29. }
Success #stdin #stdout 0s 4396KB
stdin
4 10
stdout
3