fork download
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. typedef long long ll;
  6. #define int ll
  7. typedef long double ld;
  8.  
  9. typedef pair<int,int> pii;
  10. #define x first
  11. #define y second
  12.  
  13. signed main()
  14. {
  15. ios_base::sync_with_stdio(0);
  16. cin.tie(0);
  17. cout.tie(0);
  18.  
  19. int t;
  20. cin>>t;
  21. while(t--)
  22. {
  23. int a,b;
  24. cin>>a>>b;
  25. if(a==0)
  26. {
  27. for(int i=2;i<=20;i++)
  28. cout<<1<<" ";
  29. }
  30. else
  31. {
  32. for(int i=2;i<=20;i++)
  33. cout<<int(1+b*(logl(a)/logl(i)))<<" ";
  34. }
  35. cout<<"\n";
  36. }
  37. }
  38.  
Success #stdin #stdout 0s 4480KB
stdin
1
33554432 100000
stdout
2500000 1577325 1250000 1076692 967133 890518 833334 788663 752575 722663 697358 675596 656624 639896 625000 611627 599532 588523 578446