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*(log(a)/log(i)))<<" ";
  34. }
  35. cout<<"\n";
  36. }
  37. }
  38.  
Success #stdin #stdout 0s 4512KB
stdin
1
1000 100000
stdout
996579 628771 498290 429203 385530 354989 332193 314386 300000 288076 277989 269314 261751 255083 249145 243814 238992 234604 230587